PDA

View Full Version : Simple videostacking like fuzzy


xtg05
2005-04-17, 19:06
hi, everyone. i'm xtg05 from korea.

i'd like to suggest some tags to provide "fuzzy like simple stacking" :)

"fuzzy video stacking" has been removed from xbmc cvs since 050321.

instead, they provided <videostacking> tag into xboxmediacenter.xml as follows.

* *<videostacking>
* * * *<regexp>[ _\.-]+part[ \.]+([0-9a-d]+)</regexp>
* * * *<regexp>[ _\.-]+cd[ \.]+([0-9a-d]+)</regexp>
* * * *<regexp>[ _\.0-9-]([abcd])\....$</regexp>
* * * *<regexp>[^ \.]([0-9])\....$</regexp>
* *</videostacking>


i found that newer "simple stacking" with above tag can not cover some naming conventions such as,

* *blabla-cd1-blabla.avi

i suggest a video stacking tag to cover such a naming as follows.

* *<videostacking>
* * * *<regexp>[ _\.-]*part[ _\.-]?([0-9a-d]+)</regexp>
* * * *<regexp>[ _\.-]*cd[ _\.-]?([0-9a-d]+)</regexp>
<regexp>[ _\.-]*e[ _\.-]?([0-9]+).*</regexp>
* * * *<regexp>[ _\.-]*([0-9a-d]+)\....$</regexp>
* *</videostacking>

this tag is for stacking "part", "cd", "e"(for episodes of series).

the major differences from original tag are "*", "?" and ".*".

"*" is for the expression that 0 or mutiple times appears.

"?" is for the expression that 0 or just 1 times appears.

and, ".*"is for the sub titles of episodes.

thanks.

i'm expecting your feedbacks.

xtg05@hotmail.com

XboxWare
2005-04-18, 07:00
edit: moved my post to a differnet area.

jmarshall
2005-04-18, 09:44
hmmm - have you corrected these since originally posted?

in any case, they're better now.

first 2 are great - will make these the new defaults i think.

the 3rd one doesn't need the .* at the end - regexps will just match the first occurence, so anything after the episode number won't matter anyway.

the 4th i'm not so sure about - seems to match any filename ending in a, b, c or d?

cheers,
jonathan

xboxsFan
2005-04-18, 14:13
* *<videostacking>
* * * *<regexp>[ _\.-]*part[ _\.-]?([0-9a-d]+)</regexp>
* * * *<regexp>[ _\.-]*cd[ _\.-]?([0-9a-d]+)</regexp>
* * * *<regexp>[ _\.-]*e[ _\.-]?([0-9]+).*</regexp>
* * * *<regexp>[ _\.-]*([0-9a-d]+)\....$</regexp>
* *</videostacking>
if i could give some opinions, i'd like to say the first one, <regexp>[ _\.-]*part[ _\.-]?([0-9a-d]+)</regexp> , is optional, not neccessarily needed, without this regexp, all your video files named like "abc.part.1, abc.part.2" or "abc.part1, abc.part2" still could be stacked together.


using your regexp, some video files still cannot be stacked together, for example:

scenes.from.a.marriage.1973.tv.scene.1.dvdrip.xvid-fragment
scenes.from.a.marriage.1973.tv.scene.2.dvdrip.xvid-fragment
scenes.from.a.marriage.1973.tv.scene.3.dvdrip.xvid-fragment
scenes.from.a.marriage.1973.tv.scene.4.dvdrip.xvid-fragment
scenes.from.a.marriage.1973.tv.scene.5.dvdrip.xvid-fragment
scenes.from.a.marriage.1973.tv.scene.6.dvdrip.xvid-fragment

ep-01.avi
ep-02.avi
ep-03.avi
ep-04.avi
ep-05.avi
ep-06.avi
ep-07.avi
ep-08.avi

successful student.01.avi
successful student.02.avi
successful student.03.avi
successful student.04.avi
successful student.05.avi

the.aviator.a-bmf.avi
the.aviator.b-bmf.avi


my regexp is something like this:
*<videostacking>
* * * *<regexp>[ _\.-]*cd[ _\.-]*([0-9a-d]+)</regexp>
* * * <regexp>[ _\.-]*([0-9a-d]+)\....$</regexp>
* * * * * * * * <regexp>\-([a-z0-9]+)-</regexp>
* * * * * * * * <regexp>\.([a-z0-9]+)-</regexp>
* * * * * * * * <regexp>\-([a-z0-9]+)*</regexp>
* * * * * * * * <regexp>\.([a-z0-9]+)*</regexp>
</videostacking>

all video files could be stacked together using these regexp.

the fourth one is for *video files like "the.aviator.a-bmf" , and the third one is for video files like "the.aviator-a-bmf".

the fifth one is for series like "ep-01......08.avi", the sixth one is for series like "successful student.01.....05.avi"


i'm thinking how to combine the 3th and 4th regexp into one single regexp, i tried <regexp>\(-|.)*([a-z0-9]+)-</regexp> , but to no avail, could anyone help with this?

kraqh3d
2005-04-18, 17:15
@xtg05:

what's the third one for? (the one with the "e" in it?) tv series in the s01e01 convention? and if it is for tv series, what about the 1x01 convention?


@xboxfan:

you can combine the lower four into two, like this:

<regexp>[-\.]([a-z0-9]+)-</regexp>
<regexp>[-\.]([a-z0-9]+)*</regexp>

the [-\.] means that character can be a dash or a period.

@jmarshall:

i know i'm not the only person who would prefer if tv series were not stacked by default. maybe put the regexps in the config but commented out with a note saying uncomment this to stack tv series, with an example to show the formatting.)

@all:

why do you all feel that xbmc has to do all the work to clean up *your* files? you should put some effort into this too. the supported filename conventions are very easy to understand. rename your files to fit them.

if you dont want to, then by all means please play with the regexps to match them. but dont go bitching that they should be added as new default regexps.

xboxsFan
2005-04-19, 12:25
@xboxfan:

* * * * * * * <regexp>\-([a-z0-9]+)-</regexp>
* * * * * * * *<regexp>\.([a-z0-9]+)-</regexp>
* * * * * * * *<regexp>\-([a-z0-9]+)*</regexp>
* * * * * * * *<regexp>\.([a-z0-9]+)*</regexp>


you can combine the lower four into two, like this:

<regexp>[-\.]([a-z0-9]+)-</regexp>
<regexp>[-\.]([a-z0-9]+)*</regexp>

the [-\.] means that character can be a dash or a period. *
this one: <regexp>[-\.]([a-z0-9]+)-</regexp> doesn't work for file like:

the.aviator.a-bmf.avi
the.aviator.b-bmf.avi

this one: <regexp>[-\.]([a-z0-9]+)*</regexp> works fine, thanks!

sCAPe
2005-04-19, 13:31
i want fuzzy stacking back! :)

it seems that you have to be a dev to make some new expressions in the .xml file..

kraqh3d
2005-04-19, 15:54
@scape:

fuzzy will not be put back. *we're trying to reduce unwanted stackings.

@xboxfan

i made no assumptions about what your regexps were for. *i was just showing you how to consolidate them. *if the intention of both of those was to accomodate files with the additional stuff on the end, like the group, you should really make it something like this:

<regexp>[-\.]([a-z0-9]+)[-\.]?.*</regexp>

its a seperator, followed by the volume descriptor, followed by another possible seperator, followed by all the other junk. *you can add additional seperators by adding those characters inside the sq brackets. *and if you have situations with more than one seperator character add a plus after the closing sq bracket.

actually, you can use any of these modifiers:
? = zero or one
* = zero or more
+ = one or more

xboxsFan
2005-04-19, 17:53
i tried, <regexp>[-\.]([a-z0-9]+)[-\.]?.*</regexp> didn't work,
i also tried <regexp>[-\.]([a-z0-9]+)[-\.]?</regexp> , didn't work as well.

kraqh3d
2005-04-21, 16:39
it works fine in perl. i guess the regexp engine we're using is a little off.

xboxsFan
2005-04-21, 21:58
i guess the regexp engine we're using is a little off.
does it mean we'll use a better regexp engine in the coming xbmc release? :d

Striker
2005-04-22, 23:56
how do you let things like
be.cool.dvdscr.xvid-done.1.avi
be.cool.dvdscr.xvid-done.2.avi
stack?
/me wants fuzzy back too :verysad:

but if its fixable with a bunch of regexp's i dont care ;)
i just dont understand how to make them

kraqh3d
2005-04-23, 00:33
striker,

try this:
<regexp>[ _\.-]([0-9a-d])\.....?$</regexp>

this should stack anything that has a seperator followed by a single character volume id just before the file extension. if you need to add more seperators, put them in the first set of square brackets.


i really urge you guys to put a little effort into this from your end and try renaming your files to something logical. it will greatly enhance your xbmc experience. files will stack correctly, and you'll get better results from the video scan.

Striker
2005-04-23, 14:10
tnx kraqh3d

some guys (like me) are just too lazy to rename everything
i have to say i dont use the scan function either and i normally dont keep the movie if i dont like it or i need some room on the hd

Ace25
2005-04-24, 07:16
i am having a hell of a time trying to figure this out as well. i have gone through all the effort of renaming my movies... all 400gigs worth on my xbox! problem is, like the others, what worked with fuzzy no longer does and i cant for the life of me figure out the correct string. i use spaces at the end of the movie and hide the extensions so that the title displays correctly without having all the .1, .part1, etc at the end. here is how i rename my movies.

[s] = a space (forums dont like multiple spaces so i have to use something to show its a space). here are 2 examples, one for a 2 part movie, one for a 3 part. the 3 parters i had to put in an extra space in each name because even in fuzzy it would only stack 2/3 of the files if all 3 didnt have a space at the end. with 2 part movies that wasnt a problem.

the movie[s][s][s].bin
the movie[s][s].bin
the movie[s].bin

the video[s].bin
the video.bin

any clue on what the regexp might look like for my dilema?

jmarshall
2005-04-24, 14:05
try something like:

<regexp>( +)\.....?$</regexp>

this looks for one or more spaces (the ( +) bit - the brackets means this is the bit we're gonna compare on) followed by a period (\.) followed by 3 characters (...) followed by an optional fourth character (.?) appearing at the end of the string ($).

i'm not sure how the sorting will work - it should sort in order. if it doesn't, let me know.

Ace25
2005-04-24, 18:30
awesome, that fixed my 3 part movies. my 2 part movies still dont stack since there is no space in the second part of the movie. i have been staring (and attempting different strings) for 2 straight days now. i wasnt even close to the string you wrote out.

nevermind about the other string, i just renamed all my 2 part movies to have spaces at the end of both files so now all my movies stack correctly! thanks for your help!!!

jmarshall
2005-04-24, 19:02
change the + to a *. * means 0 or more.

note that this may well mean that a bunch of other stuff gets matched as well - just something to watch out for.

as kraqh3d has stated, it's much better to just name your movies so that the default regexps do their job.

also, now that you understand how it works, how about writing something up for the online manual?

Ace25
2005-04-24, 19:08
i had tried the wild card before and some reason it acted really wierd. any movie with a space in the name ie. "the movie" would not stack, and would show up as "theovie" so it seemed to take out the space and the following letter.

just curious, if one would use and name their movies according to the example regexp in the xml wouldnt you end up with "movie.part1" or "movie.1". i know thats how it worked a long time ago and that was the reason i started using the spaces instead of numbers/letters at the end. i hated all my movies having that extra # or letter in the title.

Hullebulle
2005-04-27, 01:13
maybe we should think about making the old fuzzy stacking an option?

or just selectable in the fileview?

jmarshall
2005-04-27, 10:30
no. it was removed for a very good reason. there is no way to effectively handle the databasing options if both are available.

i'll write up on the online manual the recommended naming conventions at some stage.

gglaze
2005-05-15, 03:46
just getting back into things, totally loving what you guys did with the regex stuff. i'm thinking about integrating that with more options for cleaning file names as well.

curious about something - looking at the default settings, i can't imagine why the main 2 were left like this:

<regexp>[ _\.-]+cd[ _\.-]+([0-9a-d]+)</regexp>
<regexp>[ _\.-]+part[ _\.-]+([0-9a-d]+)</regexp>


...instead of like this:

<regexp>[ _\.-]+cd[ _\.-]*([0-9a-d]+)</regexp>
<regexp>[ _\.-]+part[ _\.-]*([0-9a-d]+)</regexp>


i don't know about you guys, but a majority of the stuff i've ever seen always had something like "-cd1" or " - cd1", and hardly ever "-cd-1" or whatever this is intended for.

anyone have a problem if i make this change to the default settings file and check it in? doesn't seem like it should break any existing stacking anyone has set up...

gglaze
2005-05-15, 05:49
also, while we're on the topic...

a couple of proposed changes:

1. move the stacking option to be under settings - appearance - view options, rather than directly on the video screen. previously i think we had it there because (1) it was easy; and (2) it was necessary to be able to constantly switch back and forth between fuzzy/simple/none... but now that we have much more granular configurability, and because there is no more need for fuzzy, i'm thinking it is just cluttering up things to have the option always visible on the main video screen. i know that i personally will never change the option, because i'll have all my regex exactly the way i want it.

2. how about if i add an option to that same settings screen, to turn on/off the "clean file names" function? currently it is an option in settings.xml, but there is no actual way to configure it - it is essentially auto-set based on the stacking mode, with the idea that that would make a good default, but someday we might actually have a gui option for it. i'm sure one of my previous bits of code already had this implemented, but i can't seem to find it anymore...

ok, let me know what you guys think.

kraqh3d
2005-05-15, 16:48
i agree with your regexp change. that seperator should be asterix'ed to allow for both "-cd1" and "-cd-1".

1) i think the stacking button should stay in the videos windows. i know i sometimes need to turn it on and off. i'm sure others do as well.

2) i'm torn on this one... while this is similar to whats done in music where the labels are set based on the tag data, the info used to set the lable comes directly from the file. where as here, xbmc is making a guess as to what the label should be by removing the tokens configured in settings.xml.

gglaze
2005-05-15, 17:46
for #2, all i'm talking about is an option to turn the feature on and off - the "cleaning" feature is already there, and it is currently always on if you have stacking turned on.

whether or not you like the feature, and whether or not it is implemented well, is another discussion - i'm happy to discuss ways to improve it, and i have a few ideas myself too. but as it stands, the feature is already there.

so if you're not exactly comfortable with it, it sounds like you agree with me - we do need an on-screen option to turn it on and off.

i am now noticing that we have some list options under video, and others under appearance. i guess this setting would be more appropriate under video, since it is only actually applied to video list. thoughts?

gglaze
2005-05-15, 17:51
also, i'm curious about #1 - with the new regex matching, what scenario could you have that would still require you to turn stacking on and off? my understanding was that in the past, this was necessary because fuzzy mode stacked many things incorrectly, or because tv episodes were getting stacked like movie volumes - but now it should be possible to avoid all of those problems, right? i'm sure there are some scenarios i haven't considered...

kraqh3d
2005-05-17, 04:20
sometimes i just like to turn it off... actually, more often then not i leave stacking off, and sometimes turn it on :)

the option to enable and disable the cleaning is fine with me. you're right in that it gets enabled automatically when stacking is enabled. i'm just stating the obvious, it's not perfect.

one thing to watch out for... all filenames go through a cleaning process before the imdb lookup, but i'm not sure if its the same cleaning process. you just need to make sure that if cleaning titles is disabled, its still cleaned when querying imdb. it helps get a better match on imdb.