Include orphaned subtitles

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Include orphaned subtitles

Post by devster »

Is there a way to avoid the following:

Code: Select all

Ignore orphaned subtitles: /mnt/bellatrix/downloads/movies/Sweet.Virginia.2017.1080p.WEB-DL.DD5.1.H264-FGT/English.srt
and instead include the subtitle to be post-processed?
I only work in black and sometimes very, very dark grey. (Batman)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Include orphaned subtitles

Post by rednoah »

Unfortunately, subtitle files that aren't named properly cannot be picked up alongside their corresponding video files in fully automatic mode. You could have a custom script pre-process files called "English.srt" to be moved one level up and renamed according to whatever video file is there.

Normally, you'd just get new subtitles from OpenSubtitles. If the new subtitles aren't good, then I recommend manually uploading the ones you already have.
:idea: Please read the FAQ and How to Request Help.
thielj
Posts: 55
Joined: 05 Nov 2017, 22:15

Re: Include orphaned subtitles

Post by thielj »

How about an option to include all orphaned files in the original movie folder with the new renamed movie, i.e. in an orphans/ folder or filebot-orphans.zip file? This would allow sorting out issues later.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Include orphaned subtitles

Post by rednoah »

That would be very difficult, because the the final destination, due to custom formats, could be anything. So orphaned subtitles would have to be processed in a second pass. In this case, I'm inclined to choose simplicity over features. Plus, orphaned subtitles are subtitles that can't easily be linked to their corresponding movies reliably (unless you make certain assumptions).

Based on the FileBot history, you could easily write a script that collects left behind files in the old location and move them to the new location. That would be a separate standalone tool that can be called after the amc script.


EDIT:

e.g.

Code: Select all

def m = getPersistentRenameLog()
m.findResults{ from, to -> 
	def leftBehindFiles = from.dir.getFiles{ !m.containsKey(it) }
	println "Unprocessed files for [$from.dir] => $leftBehindFiles"
}
:idea: Please read the FAQ and How to Request Help.
thielj
Posts: 55
Joined: 05 Nov 2017, 22:15

Re: Include orphaned subtitles

Post by thielj »

I'm aware that I could go through the history and filesystem, figure out affected directories that had at least their main movie moved / copied, determine which of the files (in case of COPY actions) would be considered orphans, and create some copy or move actions for the orphans. Most (if not all) of this information is already available at FileBot run-time. Not everyone can do this though. Most people won't even be able to install an additional script for this.

I see this less a technical exercise, but more from the average user points of view: If I let a 'robot' process my files, my minimum expectations are that none of my existing stuff is at risk or is getting left behind.

I would assume that a user selecting such an option would want orphaned files somewhere relative to their new main movie location, e.g. with keepOrphans=./.orphans/ or keepOrphans=./orphans.zip

The other possibility would be to pass {orphans} to the movie formatter script and let the script register a target location for each file.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Include orphaned subtitles

Post by rednoah »

Let's see if similar feature requests come up here in the forum in one form or another. A second pass to deal with orphaned files would most certainly be a separate script at first though.
:idea: Please read the FAQ and How to Request Help.
Post Reply