Help with filebot -revert /path/to/files

Support for Synology NAS, QNAP NAS and other Embedded Linux systems
Post Reply
stoic74
Posts: 5
Joined: 17 Jan 2017, 19:26

Help with filebot -revert /path/to/files

Post 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.

Problems
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.
User avatar
rednoah
The Source
Posts: 20995
Joined: 16 Nov 2011, 08:59

Re: Renaming Challenges

Post 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
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 20995
Joined: 16 Nov 2011, 08:59

Re: Renaming Challenges

Post 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.


1.
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.


2.
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.


3.
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.


4.
FileBot does keep a rename history. You can revert files using the filebot -revert command.
:idea: Please read the FAQ and How to Request Help.
stoic74
Posts: 5
Joined: 17 Jan 2017, 19:26

Re: Renaming Challenges

Post 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: java.io.IOException: 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]
User avatar
rednoah
The Source
Posts: 20995
Joined: 16 Nov 2011, 08:59

Re: Renaming Challenges

Post by rednoah »

Revert:

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
:idea: Please read the FAQ and How to Request Help.
stoic74
Posts: 5
Joined: 17 Jan 2017, 19:26

Re: Renaming Challenges

Post 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.
stoic74
Posts: 5
Joined: 17 Jan 2017, 19:26

Re: Renaming Challenges

Post by stoic74 »

I noticed something interesting. My directory structure for output is:
MOVIES_TV-SERIES
--> 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?
User avatar
rednoah
The Source
Posts: 20995
Joined: 16 Nov 2011, 08:59

Re: Renaming Challenges

Post by rednoah »

First, you need to learn how to use the shell:
viewtopic.php?f=4&t=1899


I shall demonstrate:

BAD:

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
GOOD:

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
:idea: Please read the FAQ and How to Request Help.
stoic74
Posts: 5
Joined: 17 Jan 2017, 19:26

Re: Renaming Challenges

Post 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
SHLVL: 2
LD_LIBRARY_PATH: /usr/local/mediainfo/lib:/usr/local/chromaprint/lib:/volume1/@appstore/filebot/lib/x86_64
LC_ALL: en_US.UTF-8
TERMINFO: /usr/share/terminfo
HOME: /var/services/homes/admin
SSH_CONNECTION: 192.168.0.3 3194 192.168.0.9 22
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: 192.168.0.3 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/%N.cat
OLDPWD: /
LANG: en_US.UTF-8
PWD: /
JAVA_HOME: /usr/local/java
USER: admin


# Java System Properties #
path.separator: :
java.vm.name: Java HotSpot(TM) 64-Bit Server VM
java.io.tmpdir: /volume1/@appstore/filebot/data/admin/temp
user.country: US
user.home: /volume1/@appstore/filebot/data/admin
net.filebot.util.prefs.file: /volume1/@appstore/filebot/data/admin/prefs.properties
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
java.vendor.url.bug: http://bugreport.sun.com/bugreport/
swing.crossplatformlaf: javax.swing.plaf.nimbus.NimbusLookAndFeel
sun.net.client.defaultReadTimeout: 60000
java.specification.name: Java Platform API Specification
jna.nosys: false
os.name: Linux
java.runtime.name: Java(TM) SE Runtime Environment
application.deployment: spk
file.separator: /
sun.net.client.defaultConnectTimeout: 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.vm.specification.name: 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
java.vendor.url: http://java.oracle.com/
sun.os.patch.level: unknown
sun.java.launcher: SUN_STANDARD
os.arch: amd64
user.dir: /
line.separator:

user.timezone:
sun.cpu.endian: little
java.vm.specification.vendor: Oracle Corporation
java.home: /volume1/@appstore/oracle-java/jdk1.8.0_111/jre
java.net.useSystemProxies: false
sun.management.compiler: HotSpot 64-Bit Tiered Compilers
sun.arch.data.model: 64
java.endorsed.dirs: /volume1/@appstore/oracle-java/jdk1.8.0_111/jre/lib/endorsed
file.encoding.pkg: sun.io
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
java.vm.info: mixed mode
java.vm.version: 25.111-b14
sun.io.unicode.encoding: 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
sun.java.command: /volume1/@appstore/filebot/FileBot.jar -script fn:sysenv /volume1/MOVIES_TV-SERIES/TV Shows
jna.nounpack: true
sun.cpu.isalist:
user.name: admin


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


Done ?(@[email protected])?
User avatar
rednoah
The Source
Posts: 20995
Joined: 16 Nov 2011, 08:59

Re: Renaming Challenges

Post 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.


EDIT:


e.g.

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]
:idea: Please read the FAQ and How to Request Help.
Post Reply