Wiki Navigation
- Loading...
Overview
This is about handling multi-part or stacked files as one media item, i.e. movie-cd1.avi and movie-cd2.avi.
Resources
Forum thread (feature request) for discussion
Feature
Thinking about the detection of multi-part videos, possible splitting of a video can be on
- file level, where the video files are in the same folder, but the filename differs or on
movie-cd1.avi
movie-cd2.avi
- directory level, where the video files are in two separate folders.
moviename\a\movie-a.avi
moviename\b\movie-b.avi
Existing Implementations
Moving Pictures
RegEx: http://code.google.com/p/moving-pict.../Utility.cs#56
// Regular expression patterns used by the multipart detection and cleaning methods // Matches the substrings "cd/dvd/disc/disk/part #" or "(# of #)" // todo: convert constants to advanced settings private const string rxFileStackPattern = @"(\W*\b(cd|dvd|dis[ck]|part)\W*([a-z]|\d+|i+)(\W|$))|\W\d+\W*(of|-)\W*\d+\W$"; private const string rxFolderStackPattern = @"^(cd|dvd|dis[ck]|part)\W*([a-z]|\d+|i+)$";
tinyMediaManager
RegEx: http://code.google.com/p/tinymediama...Utils.java#297
and it's usage: http://code.google.com/p/tinymediama...aFile.java#137
/**
* Clean stacking markers.
*
* @param filename
* the filename
* @return the string
*/
public static String cleanStackingMarkers(String filename) {
if (!StringUtils.isEmpty(filename)) {
return filename.replaceAll("(?i)([\\( _.-]*(cd|dvd|part|pt|dis[ck])([0-9])[\\) _.-]*)", "").trim();
}
return filename;
}
/**
* Returns the stacking information from filename
*
* @param filename
* the filename
* @return the stacking information
*/
public static String getStackingMarker(String filename) {
if (!StringUtils.isEmpty(filename)) {
return StrgUtils.substr(filename, "(?i)((cd|dvd|part|pt|dis[ck])([0-9]))");
}
return "";
}
Affected Areas
Multi part files doesn't have to be Movies only. Could also be "other videos" or maybe episodes for series as well?
Handling multi part files is needed in various places:
- Combining and displaying all parts as one item in gui.
- Adding an item to a playlist, editing the playlist
- Continuing playback with next part, once the previous part is finished
- when stopping a video, remember stop time (part) to allow resume.
When resuming start the right part at right time code.
Implementation Details
- Do we need relation between the local file and the movie item?
- Configurable? > Some people might want to disable file stacking.
Related

This page has no comments.