Page 1 of 1

Help with filebot -revert /path/to/files

Posted: 17 Jan 2017, 22:03
by stoic74
System Info
FileBot 4.7.7 (r4678) / Java SE Runtime Environment 1.8.0_111
Linux 3.10.77 (amd64)
Synology DS412+ running DSM 6.0.2-8451 (Update 8)
Node.js v4
Filebot Node 0.2.3
MediaInfo 0.7.73-2
Media player: Kodi 16.1

Installations and execution ran smoothly.

Maybe 15% of files renamed all wrong as I mistakenly thought exact SEries/season/set plus EPisode numbers (e.g., Se3Ep2) along with exact title would be sufficient. After the original rename and move to new folders only 2 files out of ~1500 renamed were left unnamed in original folder, i.e., color and BW version of Mark of Zorro (1940)

Some additional problems were:
1. Multi-part movies
2. B&W vs color or 4:3 vs 16:9 versions of same movie
3. Movie remakes (Sherlock Holmes_Hound of the Baskervilles -> Rathbone, Brett, Cumberbatch, etc)
5. The media databases sometimes seem to create multiple files for a movie in the way they were organized on the original DVD even though we did not necessarily use all of those files. For example, my DVD ripper allows me to merge 2 parts into one which makes viewing far easier.
6. TV Specials for TV series are not in chronological order like S00E00 and sometimes have the actors at quite different ages.

I cannot easily revert as too many files were lost or wrongly named or episodes wrongly numbered and it would take a long time to verify every episode was correct.

I can restore all original files to original single flat folder from monthly NAS backup (although it takes a lot of TB).

My original naming scheme was:
Movies= movie title_x (where x is sometimes needed for Pt1 or Pt2; color, BW, JB for Brett Sherlock Holmes series, etc)
TV Series= series name_SenEpn_title [done in original broadcast order]

My questions are:
1. What is the best way to rename my original files to have fewest filebot mistakes OR is there a way with filebot.node or filebot to better understand my original naming convention?

2. What about the problems above (1-6)?

3. Should I choose clutter files removal? Did this remove some of the movies filebot did not understand?

Thank you for a great piece of programming.

Re: Renaming Challenges

Posted: 17 Jan 2017, 22:05
by rednoah
Thanks for the post! Before a real human comes by, please make sure your report has all the following points checked:
  • What are you trying to do achieve? What's not working? What have you tried so far?
  • Include screenshots, logs or filenames (i.e. demonstrate the issue)
  • Include basic information (i.e. sysinfo output)
:idea: Please read How to Request Help and Fix Problems, Report Bugs, Get Features

Re: Renaming Challenges

Posted: 17 Jan 2017, 22:16
by rednoah
Since there's no logs I won't go into any details on what may or may not have happened with any particular file.

Well-named files avoid ambiguities. Always run with --action test first, especially on files that are named like that. -strict-mode is useful for skipping most of the more ambiguous files.

Without specific examples and test case, any generic suggestion will be useless. The default {plex} does not support the same movie with different quality settings. If you want to keep different versions of the same movie you'll need to use a custom format for that.

FileBot will not delete video files. Best to try this with a sample folder first to make sure you understand what any particular option does.

FileBot does keep a rename history. You can revert files using the filebot -revert command.

Re: Renaming Challenges

Posted: 19 Jan 2017, 02:01
by stoic74
I tried to revert all files and no result. Two log files generated below, respectively:

Reverted with these two commands:
filebot -script fn:revert --action move /volume1/MOVIES_TV-SERIES/Movies
filebot -script fn:revert --action move /volume1/MOVIES_TV-SERIES/TV Shows
filebot -script 'fn:sysinfo'


FileBot 4.7.7 (r4678)
JNA Native: 4.0.1
MediaInfo: 0.7.73
Apache Commons VFS: [zip, rar]
Chromaprint: Cannot run program "fpcalc": error=2, No such file or directory
Extended Attributes: OK
Script Bundle: 2017-01-05 (r470)
Groovy: 2.4.7
JRE: Java(TM) SE Runtime Environment 1.8.0_111
JVM: 64-bit Java HotSpot(TM) 64-Bit Server VM
CPU/MEM: 4 Core / 668 MB Max Memory / 9 MB Used Memory
OS: Linux (amd64)
Package: SPK
Data: /volume1/@appstore/filebot/data/admin
uname: Linux DiskStation 3.10.77 #8451 SMP Wed Jan 4 00:31:48 CST 2017 x86_64 GNU/Linux synology_cedarview_412+
Done ヾ(@⌒ー⌒@)ノ

[Process completed]
filebot -script 'fn:amc' /volume1/download/ --output /volume1/video/ --action duplicate -non-strict --conflict auto --lang en --def 'music=y' 'unsorted=y' 'deleteAfterExtract=y' 'excludeList=.excludes' --log all --log-file '/volume1/@appstore/filebot-node/data/filebot.log'


Locking /volume1/@appstore/filebot-node/data/filebot.log
Run script [fn:amc] at [Tue Jan 17 12:46:39 PST 2017]
Parameter: music = y
Parameter: unsorted = y
Parameter: deleteAfterExtract = y
Parameter: excludeList = .excludes
Argument[0]: File does not exist: /volume1/download
Use excludes: /volume1/video/.excludes
No files selected for processing
Done ヾ(@⌒ー⌒@)ノ

[Process completed]

Re: Renaming Challenges

Posted: 19 Jan 2017, 07:37
by rednoah

Code: Select all

filebot -revert /path/to/where/files/are/now
Verify that FileBot has all the rename records:

Code: Select all

filebot -script fn:history

Re: Renaming Challenges

Posted: 19 Jan 2017, 22:09
by stoic74
1. Issuing Revert command twice to existing paths for Movies as well as TV Series did not yield any error messages. However, no files were returned to their original folders or to existing folders.

2. Filebot does have all the original file names and the assigned renames in its history, but ONLY for the TV Series. There are no movies listed (~500 that were renamed and moved in original command which are seen in the change log).

I am not sure why the revert command did not work for at least the TV Series. The command I used was:
filebot -revert \volume1\MOVIES_TV-SERIES\TV Shows

3. I see no additional log files in filebot-node log sub-folder for these revert attempts.

4. I think I may have to delete all newly created folders by Filebot and simply restore my original single flat file from my monthly backup and then split it (movies vs tv) and use better file naming protocols.

Re: Renaming Challenges

Posted: 19 Jan 2017, 22:48
by stoic74
I noticed something interesting. My directory structure for output is:
--> Movies
--> TV Shows
with the renamed and moved output of filebot sitting in the two subdirectories. However, in the parent directory MOVIES_TV-SERIES there is a single file called ".excludes" which has ALL of the original file names and their locations in their original folders. Does this information help?

Re: Renaming Challenges

Posted: 20 Jan 2017, 05:07
by rednoah
First, you need to learn how to use the shell:

I shall demonstrate:


Code: Select all

filebot -script fn:sysenv \volume1\MOVIES_TV-SERIES\TV Shows

Code: Select all

args[0] = -script
args[1] = fn:sysenv
args[2] = volume1MOVIES_TV-SERIESTV
args[3] = Shows

Code: Select all

filebot -script fn:sysenv "/volume1/MOVIES_TV-SERIES/TV Shows"

Code: Select all

args[0] = -script
args[1] = fn:sysenv
args[2] = /volume1/MOVIES_TV-SERIES/TV Shows

Re: Renaming Challenges

Posted: 21 Jan 2017, 19:56
by stoic74
Command with forgotten quotes and output but no reverting of files to original directories. It looks like the -script argument (0) may be an issue.

Code: Select all

[email protected]:/$ filebot -script fn:sysenv "/volume1/MOVIES_TV-SERIES/TV Shows"          # Environment Variables #
_: /usr/local/bin/java
MAIL: /var/mail/admin
LOGNAME: admin
LD_LIBRARY_PATH: /usr/local/mediainfo/lib:/usr/local/chromaprint/lib:/volume1/@appstore/filebot/lib/x86_64
TERMINFO: /usr/share/terminfo
HOME: /var/services/homes/admin
PATH: /sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin:/usr/local/chromaprint/bin
SSH_TTY: /dev/pts/7
SSH_CLIENT: 3194 22
PAGER: more
XFILESEARCHPATH: /usr/dt/app-defaults/%L/Dt
SHELL: /bin/sh
PGDATA: /var/services/pgsql
TERM: xterm
NLSPATH: /usr/dt/lib/nls/msg/%L/
PWD: /
JAVA_HOME: /usr/local/java
USER: admin

# Java System Properties #
path.separator: : Java HotSpot(TM) 64-Bit Server VM /volume1/@appstore/filebot/data/admin/temp US
user.home: /volume1/@appstore/filebot/data/admin
net.filebot.util.prefs.file: /volume1/@appstore/filebot/data/admin/
useExtendedFileAttributes: true
net.filebot.Archive.extractor: ApacheVFS
org.apache.commons.logging.Log: org.apache.commons.logging.impl.NoOpLog
java.vm.vendor: Oracle Corporation
java.util.prefs.PreferencesFactory: net.filebot.util.prefs.FilePreferencesFactory
user.language: en
java.vendor: Oracle Corporation
swing.crossplatformlaf: javax.swing.plaf.nimbus.NimbusLookAndFeel 60000 Java Platform API Specification
jna.nosys: false Linux Java(TM) SE Runtime Environment
application.deployment: spk
file.separator: / 10000
java.vm.specification.version: 1.8
sun.boot.class.path: /volume1/@appstore/oracle-java/jdk1.8.0_111/jre/lib/resources.jar:/volume1/@appstore/oracle-java/jdk1.8.0_111/jre/lib/rt.jar:/volume1/@appstore/oracle-java/jdk1.8.0_111/jre/lib/sunrsasign.jar:/volume1/@appstore/oracle-java/jdk1.8.0_111/jre/lib/jsse.jar:/volume1/@appstore/oracle-java/jdk1.8.0_111/jre/lib/jce.jar:/volume1/@appstore/oracle-java/jdk1.8.0_111/jre/lib/charsets.jar:/volume1/@appstore/oracle-java/jdk1.8.0_111/jre/lib/jfr.jar:/volume1/@appstore/oracle-java/jdk1.8.0_111/jre/classes
java.version: 1.8.0_111
http.agent: FileBot 4.7.7
java.library.path: /usr/local/mediainfo/lib:/usr/local/chromaprint/lib:/volume1/@appstore/filebot/lib/x86_64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
unixfs: false
awt.toolkit: sun.awt.X11.XToolkit Java Virtual Machine Specification
os.version: 3.10.77
useCreationDate: false
file.encoding: UTF-8
java.awt.printerjob: sun.print.PSPrinterJob
grape.root: /volume1/@appstore/filebot/data/admin/grape
java.class.version: 52.0
java.ext.dirs: /volume1/@appstore/oracle-java/jdk1.8.0_111/jre/lib/ext:/usr/java/packages/lib/ext
java.specification.version: 1.8
sun.os.patch.level: unknown SUN_STANDARD
os.arch: amd64
user.dir: /

sun.cpu.endian: little
java.vm.specification.vendor: Oracle Corporation
java.home: /volume1/@appstore/oracle-java/jdk1.8.0_111/jre false HotSpot 64-Bit Tiered Compilers 64
java.endorsed.dirs: /volume1/@appstore/oracle-java/jdk1.8.0_111/jre/lib/endorsed
java.specification.vendor: Oracle Corporation
sun.boot.library.path: /volume1/@appstore/oracle-java/jdk1.8.0_111/jre/lib/amd64
sun.jnu.encoding: UTF-8
java.runtime.version: 1.8.0_111-b14 mixed mode
java.vm.version: 25.111-b14 UnicodeLittle
java.awt.graphicsenv: sun.awt.X11GraphicsEnvironment
application.dir: /volume1/@appstore/filebot/data/admin
java.awt.headless: true
java.class.path: /volume1/@appstore/filebot/FileBot.jar /volume1/@appstore/filebot/FileBot.jar -script fn:sysenv /volume1/MOVIES_TV-SERIES/TV Shows
jna.nounpack: true
sun.cpu.isalist: admin

# Arguments #
args[0] = -script
args[1] = fn:sysenv
args[2] = /volume1/MOVIES_TV-SERIES/TV Shows

Done ?(@[email protected])?

Re: Renaming Challenges

Posted: 21 Jan 2017, 20:01
by rednoah
The sysenv script is just there for debugging purposes, so you can see the arguments you're passing in. If you want to revert files, then you need to call filebot -revert correctly.



Code: Select all

$ filebot -rename . -non-strict
[MOVE] Rename [alias.1x01.mkv] to [Alias - 1x01 - Truth Be Told.mkv]
$ filebot -revert .
Revert [Alias - 1x01 - Truth Be Told.mkv] to [alias.1x01.mkv]

Re: Help with filebot -revert /path/to/files

Posted: 06 Aug 2022, 00:57
by rednoah