Kodi Community Forum

Full Version: Problem with Stacking: doesn't work in library
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello forum,

I have a problem I wasn't able to solve by myself (or with searching/wikis).

I have my movies organized in folders with one folder for each movie.
But in those folders are also files for trailers or additional features like:

MovieA (Folder)
- MovieA - Trailershow1 (file)
- MovieA - Trailershow2 (file)
- MovieA - MainMovie (file)
- MovieA - MakingOf (file)

So now I want that the library only has an entry for MovieA and when I start it it should play those files in order as they are in the folder.

I searched a while and found that this task could be done with file stacking.
So I tried a bit with file stacking and reg-ex to get a scheme for my specific structure.
Now when I browse the folder and enable to stack files, everything looks as I expected:
One entry for MovieA and when I start it plays the files in the order they were in the folder.

Now comes the part I do not understand:
In movie/library mode the movie parts DON'T get stacked - I get 4 entries for the above example.
But everything I found about this topic is that if files get stacked in file mode they are automatically treated as ONE move in the library.

Am I missing something or did I get something wrong?
How can I achieve that I only get one entry "MovieA" in library mode?
Or is there an other - maybe better way to organize such a scenario?

Help an hints welcome.
Even when I think it has nothing to do with the operating system: I use Win7 64bit and Frodo RC1 (und 11 I had the same problem)

Thanks and greetings,

Nickname777
All the filenames must be exactly the same with the only exception being cd1, cd2, cd3 added to the end..

here is another post discussing the same type of issue...

http://forum.xbmc.org/showthread.php?pid...#pid847225
Thanks Ardalista for your reply.
The thread you linked to I did not find earlier.
(2012-12-13, 14:31)Ardalista Wrote: [ -> ]All the filenames must be exactly the same with the only exception being cd1, cd2, cd3 added to the end..
That is the case for default behaviour.
But I used a modified reg ex which matches the above file names.
I also did a test with a naming scheme like yours.
The result was the same: they stacked in file mode and appeared as multiple movies in library mode.

Further thoughts to file stacking:

When I looked at the filestacking description in the wiki (Link) I found that this is how file stacking is processed:

Code:
<moviestacking>
  <regexp>(Title)(Volume)(Ignore)(Extension)</regexp>
</moviestacking>

Then I understand that the example I gave would not stack.
Quote:MovieA (Folder)
- MovieA - Trailershow1 (file)
- MovieA - Trailershow2 (file)
- MovieA - MainMovie (file)
- MovieA - MakingOf (file)

But when I change it to:
Code:
MovieA (Folder that contains)
MovieA - 1 - Trailershow1.mkv
MovieA - 2 - Trailershow2.mkv
MovieA - 3 - MainMovie.mkv
MovieA - 4 - MakingOf.mkv
It should stack with reg ex
Code:
^(\w*) - (\d) - (.*?)(\.[^.]+)$
which yields:
(Title) -> MovieA
(Volume) -> 1
(Ignore) -> Trailershow1
(Extension) -> .mkv

(I use http://www.regextester.com/)

Shouldn't that stack those movies (again: in file mode they appear correctly stacked as one entry)?
So that they also are stacked in library mode?

Nickname777

not so convinced the string is valid for XBMC....

can you try with this and let me know the result...

Code:
(.*?) - ([0-9]) - (.*?)(\.[^.]+)$
(2012-12-13, 18:14)Ardalista Wrote: [ -> ]can you try with this and let me know the result...
Sure - thanks a lot!
I will also have another try with a naming scheme like you recommended when I am at home:
Code:
MovieA CD1.mkv
MovieA CD2.mkv
MovieA CD3.mkv
MovieA CD4.mkv

Can you say something about the strange fact that the files are shown as stacked in file view but not in library mode?
That was the part I was wondering about the most...
Thanks again,

Nickname

Yeah it seems odd to stack in one view but not the other, I can't do any testing myself until I get home in about 4-5 hours time as I'm stuck here at work myself.

Will get back to you once I get home and have had a play with my setup.

Edit: just remembered I can remote into one of my machines at home from work so I did...

I looked att he way a split movie is displayed in files mode and it just runs down the page...

i.e

movie (1999) cd1.avi
movie (1999) cd2.avi

so these are not what I'd consider to be stacked...

and in library mode I only have one entry. but I'm using the above file naming convention which fits in perfectly with the stadard regular expressions.

yeah it's only two parts of one move but it could just as easily be a trailer followed by the movie.. I think the only thing I've seen that had caused issues for people was a different file extension between the different files they were trying to stack.

will leave things for now until you have had a chance to test the alternative string.. also that string I gave you is hard coded for the " - " in between the movie name, volume, type.extn so you could add some flexibility to the string by using this...

Code:
(.*?)[ _.-]*([0-9])[ _.-]*(.*?)(\.[^.]+)$

this should allow various options for the seperator

Edit #2: Just thinking.. you're not getting File mode and library mode mixed up are you? as far as I'm aware file mode doesn't stack but library mode does and if one view on your system is stacked then there could just be an issue with confusion.
(2012-12-13, 18:24)Ardalista Wrote: [ -> ]Yeah it seems odd to stack in one view but not the other, I can't do any testing myself until I get home in about 4-5 hours time as I'm stuck here at work myself.
...
Code:
(.*?)[ _.-]*([0-9])[ _.-]*(.*?)(\.[^.]+)$

this should allow various options for the seperator
Hi again!
Now I have been home yesterday and did some more tests with your advices.
And I finally got stacking working like I hoped.

The first thing is that I got the description for the 4 matches in the reg ex wrong:
Code:
<regexp>(Title)(Volume)(Ignore)(Extension)</regexp>
"For each consecutive filename where all tokens except Volume match, the file's index in the file list is stored in a vector." (About file stacking)
That means that even the (Ignore)-labeled token in the reg ex has to be same for all files in the folder.

The second thing was that my reg ex had some problems with the " - "-separator. So I changed my separator to Partxx.

And as I want to keep descriptions on what the single files in the folder contain (trailer, additional material, ...) I changed the reg ex a bit to handle files that differ on more than only the volume token.

Now my folder structure contains several files for single movies in the following way:
Code:
MovieA - Part01 - Trailershow1.mkv
MovieA - Part02 - Trailershow2.mkv
MovieA - Part03 - MainMovie.mkv
MovieA - Part04 - MakingOf.mkv

With the reg ex
Code:
<regexp>(.*?)[ _.-]*((?:cd|dvd|p(?:ar)?t|dis[ck]|d)[ _.-]*[0-9]+)().*?(\.[^.]+)$</regexp>
even those files get correctly stacked and show up as a single movie in library mode.
I moved the seperator [ _.-]* out of the tokens then made a fake tokes for the (Ignore)-Part () and added place holder for my additional descriptions out of those 4 tokens .*? (this is maybe a bit on the dirty side of a solution, but works for me without flaws as far as I can see).

The good thing is that this expression also handles movies from series correct like
Code:
MovieA - 01 - Fancy Name For First Part Of Trilogy - Part01 - Trailershow1.mkv
MovieA - 01 - Fancy Name For First Part Of Trilogy - Part02 - Trailershow2.mkv
MovieA - 01 - Fancy Name For First Part Of Trilogy - Part03 - MainMovie.mkv
MovieA - 01 - Fancy Name For First Part Of Trilogy - Part04 - MakingOf.mkv

An other info I can share is, is that if the first file only has stereo sound (trailer show or similar) the main movie plays correctly in the provided surround sound - my receiver even switches the modes on his own.

The only minor drawbacks I still have with this solution is
- In library mode the sound format of the first file is displayed and not the format of the main movie.
- When I play a movie with trailers before the movie I cannot skip to the main movie, but have to seek till the trailers are over.
- The length of the movies is not correct as it is the combined length of all files including making ofs and so on.

And those are not big issus for me - but if anybody has ideas how I could solve these... Hints appreciated ;-)

And thanks again Ardalista - your posts nudged me to helpful directions.
Maybe somebody else finds this helpful.

(2012-12-13, 18:24)Ardalista Wrote: [ -> ]Edit #2: Just thinking.. you're not getting File mode and library mode mixed up are you? as far as I'm aware file mode doesn't stack but library mode does and if one view on your system is stacked then there could just be an issue with confusion.
In file mode activate the "stack files"-option in the options on the left hand side.
The folders are displayed as single entries if files in this folder had been stacked.

Greetings,

Nickname
Well done.. the main thing is you have it working for your particular scenario...

The other issues you have highlighted in regards to run time etc.. you should be able to resolve these by manually editing the .nfo files for each movie.

Code:
<movie>
  <fileinfo>
    <streamdetails>
      <audio>
        <codec>ac3</codec>
        <channels>6</channels>
      </audio>
    </streamdetails>
  </fileinfo>
  <runtime>120</runtime>
</movie>