File stacking: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
m (Robot: Changing Category:Video Library to Category:Video library)
No edit summary
Line 48: Line 48:


{{forum link2|[[forum:138640|File Stacking multiple CD's forum thread discussion]]}}
{{forum link2|[[forum:138640|File Stacking multiple CD's forum thread discussion]]}}
{{frodo updated}}
{{gotham updated}}


[[Category:XBMC Manual]]
[[Category:XBMC Manual]]
[[Category:Video library]]
[[Category:Video library]]

Revision as of 20:23, 29 August 2014

Home icon grey.png   ▶ Video library ▶ Video management ▶ Naming video files ▶ File stacking

XBMC's file stacking feature handles your multi-part videos in a clean, intuitive manner. File stacking combines your multi-part files into a single item in the file list or library. Playback of stacks is completely transparent to you as the user, all parts are automatically queued for playback in order. Stacking is a view option available in videos file mode window. It is always applied when scanning movies into the library.

File stacking only works for movies and does not work yet for TV shows.

How does file stacking work?

The stacking function is presented with a list of file items from a directory listing.

  1. Sort the file list alphabetically.
  2. PART1, PART2, ..., PART9 directories are collapsed if they contain only one video file.
  3. Each filename is tokenized into Title, Volume, Ignore and Extension parts.
  4. For each consecutive filename where all tokens except Volume match, the file's index in the file list is stored in a vector.
  5. Once the above condition fails...
    1. The stack path is generated (eg. "stack://movie-part1.mkv , movie-part2.mkv")
    2. The stack name is created from the Title Ignore and Extension tokens (eg. movie.mkv)
    3. The path and label of the first file item are replaced by the stack path and stack name, respectively.
    4. The remaining file items in the stack are removed from the file list.
  6. This continues until the file list is exhausted.

Stacking name extensions

The following are default stacking extensions that can be added to file names

# can be 1 through 9 or A through D. No spaces between the "part" and number.

  • ​part#​
  • ​cd#​
  • ​dvd#​
  • ​pt#​
  • ​disk#​
  • ​disc#​


You can also use:

  • moviename#.ext

where # can be A through D.

Limits

  • Stacking is currently only applied to movies.
  • Stacking is currently only applied to filenames, not the full path.
  • The default expressions will NOT stack files which use only a number as the volume token (eg movie1.avi, movie2.avi). This is intentional due to false positives which can occur with sequels in a flat directory layout. Some solutions to this problem (in order of best to worst) follow...
    1. Use a dir-per-movie directory layout, see the append example of the moviestacking advanced setting.
    2. Rename offending files to match one of the more specific volume tokens (ie. cd1, part1, etc).
    3. Create special-case regular expressions for those files that fail to stack (see #Fine tuning).

Fine tuning

File stacking can be tuned by the user to match obscure cases using the moviestacking advancedsettings.xml setting:

<moviestacking>

This is used by the file stacking algorithm to combine multi-part files and contains a list of regular expressions. For stacking videos that are contained in folders, such as VIDEO_TS folders, see <folderstacking>

As of v9.11, video stacking regular expressions must contain exactly four (4) capture expressions.

Default:

<moviestacking>
  <!-- <cd/dvd/part/pt/disk/disc> <0-N> -->
  <regexp>(.*?)([ _.-]*(?:cd|dvd|p(?:ar)?t|dis[ck])[ _.-]*[0-9]+)(.*?)(\.[^.]+)$</regexp>
  <!-- <cd/dvd/part/pt/disk/disc> <a-d> -->
  <regexp>(.*?)([ _.-]*(?:cd|dvd|p(?:ar)?t|dis[ck])[ _.-]*[a-d])(.*?)(\.[^.]+)$</regexp>
  <!-- movienamea-xvid.avi, movienameb-xvid.avi -->
  <regexp>(.*?)([ ._-]*[a-d])(.*?)(\.[^.]+)$</regexp>
</moviestacking>

If the argument action="append" or append="yes" is supplied, the default moviestacking regular expressions will remain intact and the user specified ones will be added to the end.

Example:

<moviestacking action="append">
    <!-- This expression will match movename1-xvid.avi, moviename2-xvid.avi.
         Be warned that it will likely stack sequels in a flat directory layout,
         so it is only recommend in a dir-per-video layout. -->
  <regexp>(.*?)([ ._-]*[0-9])(.*?)(\.[^.]+)$</regexp>
</moviestacking>


If the argument action="prepend" is supplied, the default moviestacking regular expressions will remain intact and the user specified ones will be added to the beginning.

Example:

<moviestacking action="prepend">
  <regexp>(Title)(Volume)(Ignore)(Extension)</regexp>
</moviestacking>

If no argument is supplied, or the argument append="no" is supplied, the default moviestacking regular expressions are overwritten by the user specified ones.


Attention talk.png File Stacking multiple CD's forum thread discussion