Personal Video Database

English => Support => Topic started by: rick.ca on January 22, 2009, 03:42:08 am

Title: File Scanner and Regular Expressions
Post by: rick.ca on January 22, 2009, 03:42:08 am
Changelog:
-Feature: RegExp support and additional functionality for File Scanner and Organize files by episodes function

Is there a particular external RegEx reference we should use as a guide in creating our own expressions? I know very little about RegEx (other than it makes my brain hurt), but I assume there are different "flavours." Are there any special terms that are unique to PVD?

If the scanner is unable to match a file to an existing record, the title can be edited, but the only available action is to "Add new movie." It would be nice if it re-checked the database for a match if the user edits the title (and perhaps a "refresh" requested) so the "Update file path" action would be available.

When adding new episode files to existing series, the existing title and year are removed. Title is changed to "#S.E" and Year to "-1." This happens whether or not "Automatically import... Movie information" is selected (i.e., the problem can't be worked-around by selecting that).

What is meant by "Organize files by episodes function"?
Title: Re: 0.9.9.4 File Scanner
Post by: nostra on January 23, 2009, 01:24:59 am
Quote
Is there a particular external RegEx reference we should use as a guide in creating our own expressions? I know very little about RegEx (other than it makes my brain hurt), but I assume there are different "flavours." Are there any special terms that are unique to PVD?

This is the best references on the net (I think):
http://www.regular-expressions.info/tutorial.html

Quote
If the scanner is unable to match a file to an existing record, the title can be edited, but the only available action is to "Add new movie." It would be nice if it re-checked the database for a match if the user edits the title (and perhaps a "refresh" requested) so the "Update file path" action would be available.

I'll think about it

Quote
When adding new episode files to existing series, the existing title and year are removed. Title is changed to "#S.E" and Year to "-1." This happens whether or not "Automatically import... Movie information" is selected (i.e., the problem can't be worked-around by selecting that).

Try to make the plugin overwrite titles.

Quote
What is meant by "Organize files by episodes function"?

If you have all files of a series assigned to a main series record, you can right click the record and select "Organize files by episodes" to assign each file to it's corresponding episode.
Title: Re: 0.9.9.4 File Scanner
Post by: rick.ca on January 23, 2009, 04:51:19 am
Quote
Try to make the plugin overwrite titles.

The plugins I selected with "Automatically import... Movie information" were configured to overwrite titles and year. When I run them directly (after the scanner update has removed the title and date), they work correctly. It appears that when they are used with the scanner, they are run first (although the information displayed is not updated), and then the title and year are replaced with "#S.E" and "-1" at the same time the file path is added.

In any case, if nothing is selected under "Automatically import... Movie information," nothing should happen except for the addition of the file path.

Quote
If you have all files of a series assigned to a main series record, you can right click the record and select "Organize files by episodes" to assign each file to it's corresponding episode.

Sorry, you have explained this before. You've finally filled-up my brain's ability to remember features. You'll have to get rid of some. So why do we need this feature, if the scanner is going to organize files correctly in the first place? ;D
Title: Re: 0.9.9.4 File Scanner
Post by: rick.ca on January 23, 2009, 05:31:22 am
This screenshot illustrates something I wasn't really expecting from the scanner. The subject file is a test for a movie that doesn't yet exist in the database. What's happened is it's been matched to S14 E06 of ER—the title of which is "Test." I right-clicked on Action and changed it to Add new movie, but it added the file to the existing episode anyway.

Perhaps the logic of the matching routine can made to avoid matching movies to series (and series to movies, if that is even possible). Also, it should be possible to change the action using the context menu (and it should do what you tell it to do!).

[attachment deleted by admin]
Title: Re: 0.9.9.4 File Scanner
Post by: nostra on January 24, 2009, 01:28:23 am
Quote
The plugins I selected with "Automatically import... Movie information" were configured to overwrite titles and year. When I run them directly (after the scanner update has removed the title and date), they work correctly. It appears that when they are used with the scanner, they are run first (although the information displayed is not updated), and then the title and year are replaced with "#S.E" and "-1" at the same time the file path is added.

In any case, if nothing is selected under "Automatically import... Movie information," nothing should happen except for the addition of the file path.

OK, I'll check and fix this

Quote
I right-clicked on Action and changed it to Add new movie, but it added the file to the existing episode anyway.

Oh, I have forgotten to implement this functionality for episodes, sorry.

Quote
Perhaps the logic of the matching routine can made to avoid matching movies to series (and series to movies, if that is even possible).

It sounds like a good idea.
Title: Re: 0.9.9.4 File Scanner
Post by: patch on February 21, 2009, 07:55:35 am
Some of my TV series are named without a letter designating series & episode eg for Avatar http://www.imdb.com/title/tt0417299/ Series 2 episode 1 is named
Avatar.The.Last.Airbender.-.201_The_Avatar_State_[Moonsong].avi

The scanner assigns it to series 1 episode 201

Has any one found a way to support this form of series numbering or should I rename my files?
Title: Re: 0.9.9.4 File Scanner
Post by: rick.ca on February 21, 2009, 11:10:08 am
(?i)^.*\\(?P<title>.*)(s|\b)(?P<season>[0-9]{1})(?P<episode>[0-9]{2}) works.

This regex stuff is going to make my head explode. I found this by trial and error, so I still don't have a clue what most of this means. I started with one of the default expressions, in which I guessed "[0-9]{1,3}" meant match "1 to 3 digits." So I changed that to "match 1 digit for season and then 2 digits for episode."

Now I'm going to lose sleep dreaming about all the ways this won't work. Series with more than 9 seasons, seasons with more than 99 episodes, another 3-digit number later in the filename, the "201" not delimited the way it is...

Who's going to be our regex guru? :-\
Title: Re: 0.9.9.4 File Scanner
Post by: patch on February 21, 2009, 03:09:20 pm
(?i)^.*\\(?P<title>.*)(s|\b)(?P<season>[0-9]{1})(?P<episode>[0-9]{2}) works.

Thanks rick.ca this worked well for me.

Now I'm going to lose sleep dreaming about all the ways this won't work. Series with more than 9 seasons, seasons with more than 99 episodes, another 3-digit number later in the filename, the "201" not delimited the way it is...
Yep like how should we handle "Beverly Hills, 90210" http://www.imdb.com/title/tt0098749/ currently my file name is
Beverly.Hills.90210.S01E01.Class.Of.Beverly.Hills.avi

Looks like an early rule finding S<season>[0-9]{1-2}E<episode>[0-9]{2} which takes everything prior to this as the series title would work. "S" & "E" need to be upper or lower case.

Looks like I'm going to need to learn to read regex but it looks like hieroglyphics to me.

Would also like to use more of the path information if possible as I generally file my TV series as
Series title/s1/ etc

But perhaps I'm just going to have to make sure  my file names correspond to some standard
Title: Re: 0.9.9.4 File Scanner
Post by: nostra on February 21, 2009, 04:02:02 pm
Have you took a look at the link I provided above: http://www.regular-expressions.info/tutorial.html
There is everything you need to know about regex, good explained...
Title: Re: 0.9.9.4 File Scanner
Post by: rick.ca on February 21, 2009, 09:51:36 pm
Quote
There is everything you need to know about regex

Yes, perhaps it will serve well as our regex guru. :)  It made my brain hurt the first time I looked, but now I see I can use it to figure things out fairly quickly. For example...

Quote
"S" & "E" need to be upper or lower case.

(?i) turns on case insensitivity mode (http://www.regular-expressions.info/modifiers.html).

Quote
Would also like to use more of the path information

That can be done by matching the "\" (i.e., that which denotes a directory). But the backslash is the escape character used to designate special characters (http://www.regular-expressions.info/characters.html)—so it's matched with "\\". Note that is used multiple times in the default expressions for handling movies. The ^.*\\ in my expression means "match any number of any characters from the start of the string to '\'". So my guess is the required expression might be something like this:

(?i)^.*\\(?P<title>.*)\\(s|\b)(?P<season>[0-9]{1,2})\\(?P<episode>[0-9]{1,2}).?-.?(?P<eptitle>\w*\b)

Quote
?P<title>, ?P<season>

Recognizing the PVD field names, I understood what these were doing—but not how. Now I understand that which is inside "()" is a "group" which is "captured." ?P<name> names a group, which would otherwise just be numbered from left to right. This obviously determines how data is passed back to the program.

Nostra, are any fields other than title, season, episode and eptitle supported. For example, can I make an expressions to capture things like year, director, rating from filenames?

[Edit] Oops, I see year in one of them. Maybe more to the point: Can any fields be used, or just the ones you've provided for?
Title: Re: 0.9.9.4 File Scanner
Post by: nostra on February 22, 2009, 02:05:17 am
Nostra, are any fields other than title, season, episode and eptitle supported. For example, can I make an expressions to capture things like year, director, rating from filenames?

You can only get title, original title, episode title, season number, episode number, and year.
(There is a bug in the current version that produces wrong results when getting original title without title)

P.S. Your observations above are perfectly right ;)
Title: Re: 0.9.9.4 File Scanner
Post by: patch on February 28, 2009, 05:02:57 pm
Have you took a look at the link I provided above: http://www.regular-expressions.info/tutorial.html
Thanks for the reference, I also looked at http://en.wikipedia.org/wiki/Regex for a more concise but cryptic explanation.

Decided my two main series search patterns should be

(?i)^.*\\(?P<title>[^\\]*?)\bs(?P<season>[0-9]{1,2})[ .x]{0,2}e(?P<episode>[0-9]{1,2})\b[ .-]*(?P<epititle>[^\\]*)$

(?i)^.*\\(?P<title>[^\\]*?)[ .-]*\b(?P<season>[0-9]{1,2})x(?P<episode>[0-9]{1,2})\b[ .-]*(?P<epititle>[^\\]*)$

They basically look for a file name containing text of the form "s11e11" or "11x11" bounded by word boundaries. Where the s11 & e11 can be separated by " ", "-" or "x"

I usually store my TV series in the format
Title\s1\episode file
So I precede the above by directory structure searches i.e. Look for “Title\s1\” and use this data in preference. File names are searched from more to less stringent formats i.e. Look for “Title\s1\” with file name formats
    text s0e00 episode title
    text 00x00 episode title
    Text 0 optional not digit 00 episode title (digit but not word boundary required)
    text 00 episode title

My regex for which are

(?i)^.*\\(?P<title>[^\\]*)\\s(?P<season>[0-9]{1,2})\\[^\\]*?\bs([0-9]{1,2})[ .x]{0,2}e(?P<episode>[0-9]{1,2})\b[ .-]*(?P<epititle>[^\\]*)$

(?i)^.*\\(?P<title>[^\\]*)\\s(?P<season>[0-9]{1,2})\\[^\\]*?\b[0-9]{1,2}x(?P<episode>[0-9]{1,2})\b[ .-]*(?P<epititle>[^\\]*)$

(?i)^.*\\(?P<title>[^\\]*)\\s(?P<season>[0-9]{1,2})\\[^\\]*?(?<![0-9])[0-9]{1,2}[^\\0-9]*(?P<episode>[0-9]{2})(?![0-9])[ .-]*(?P<epititle>[^\\]*)$

(?i)^.*\\(?P<title>[^\\]*)\\s(?P<season>[0-9]{1,2})\\[^\\]*?(?<![s0-9])(?P<episode>[0-9]{2})(?![0-9])[ .-]*(?P<epititle>[^\\]*)$

Hope this helps some others despite the fact it is not yet working 100% as expected

Edit
regex updated
Title: Re: 0.9.9.4 File Scanner
Post by: patch on March 01, 2009, 02:10:54 pm
Residual problems

For file / path "G:\Video - TV Series\Tripping the Rift\s2\Tripping.The.Rift.S02E02.You.Wanna.Put.That.Where.DVDRip.avi"
PVD using the Regex by path or file name -> series name "ping the Rift" or "ping The Rift" respectively but I suspect that is a problem with the replace function

epititle doesn't seam to do anything


By the way
The best way I have found to get these regex working is to make a text file with examples of all the common and hard names you are trying to recognise.
Open this file with Edit Pad Pro
Copy each regex into the search window (it colours them for you to show the meaning of each character in the regex, helping find syntax errors)
Search your test file with the expression to make sure it does what you expect.
Title: Re: 0.9.9.4 File Scanner
Post by: rick.ca on March 02, 2009, 12:25:01 am
Quote
I suspect that is a problem with the replace function

Wouldn't that be the (?i).?((?<!\b).){0,5}Rip replacement at work?

Yes, it appears epititle doesn't work.

I found a bug while playing with the replacement function...

Attempting to change the order of any of the replace expressions using the up/down arrows results in the error:

Unexpected exception:
The source tree must contain the source node. (C:\Program Files\Virtual Treeview\Source\VirtualTrees.pas, line 26510)


The program becomes completely unresponsive—it has to be killed.

I was able to remove an expression, but adding one results in the error (after saving and reopening Preferences):

Unexpected exception:
List index out of bounds (8 )


On restarting the program, it's apparent the configuration file is corrupted, as settings are not recognized. I recovered by replacing the FindExps= line with one from backup.
Title: Re: 0.9.9.4 File Scanner
Post by: nostra on March 02, 2009, 01:40:12 am
I could not find any problems with the replace function and <epititle> works here as well. Could you explain how to reproduce the problem with eptitle?
Title: Re: 0.9.9.4 File Scanner
Post by: rick.ca on March 02, 2009, 03:25:07 am
I forgot what I reported at the beginning of this topic...

Quote
When adding new episode files to existing series, the existing title and year are removed. Title is changed to "#S.E" and Year to "-1."

It also doesn't work if the series does not already exist. I don't know of any other circumstance where might see Episode title being passed from the filename. What do you mean by "<epititle> works here"?

I tried a few more things with the replace expressions issue:

I created a new database, using the same configuration file. The same errors occurred.

I removed the configuration file, forcing the program to create a new default configuration on startup. The same errors occurred with both the new database created in the previous test, and my regular database.

The first error doesn't always happen at the same time. Once I was able to change an expression's position in the list and close and reopen the Preferences dialog without the error happening. Then I tried to make another change, and the error happened immediately. The second error seems more consistent.
Title: Re: 0.9.9.4 File Scanner
Post by: nostra on March 03, 2009, 01:04:26 pm
Quote
It also doesn't work if the series does not already exist. I don't know of any other circumstance where might see Episode title being passed from the filename. What do you mean by "<epititle> works here"?

Ehm, sorry, it seems like I have fixed the issue as you reported it the first time, but forgot about it ::) That's why it works here.

Quote
I created a new database, using the same configuration file. The same errors occurred.

I removed the configuration file, forcing the program to create a new default configuration on startup. The same errors occurred with both the new database created in the previous test, and my regular database.

The first error doesn't always happen at the same time. Once I was able to change an expression's position in the list and close and reopen the Preferences dialog without the error happening. Then I tried to make another change, and the error happened immediately. The second error seems more consistent.

You can stop investigating this issue as I have already found where the problem was and fixed it.
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: rick.ca on May 31, 2009, 08:29:49 pm
Moved here from Beta forum—to provide a place to discuss how to modify the regex in the file scanner configuration so the scanner will better recognize your files.
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: rick.ca on June 02, 2009, 01:54:40 am
I've mentioned several times the effective use of the file scanner involves finding one's preferred balance between


In other words, we have a choice of


There is no excaping the necessity of learning at least a little bit about regex. If one chooses the latter approach (to avoid having to adapt the regex to their circumstances), they will soon realize the best method of implementing the second step is to use a regex file renamer.

So here are some references I've found helpful...

Regular Expressions:


File Renaming:

Title: TV Series & File Scanner
Post by: darichman on June 06, 2009, 05:53:51 am
Hello hello.

I've taken the plunge and have started looking at importing TV shows in PVD. I have all my TV shows in the file format...

E:\Television\Dark Angel\Season 2\Dark Angel - 2-03. Proof of Purchase

The default filescanner is picking up the show title as "Dark Angel - 1" and "Dark Angel - 2" etc and not picking up the Episode Name part of the filename. Before I go and to a whole lot of manual work, is there any way to set the filename scanner to pick up the season and the episode name if all my filenames are in this format?

I've been fiddling with the RegExps options for the file scanner to try and get PVD to pick files up as

<title> - <season>-<episode>. <eptitle>

So far I haven't had any luck. If anyone has any suggestions, I'd be really grateful :)
Title: Re: TV Series & File Scanner
Post by: patch on June 06, 2009, 06:08:54 am
I have all my TV shows in the file format...
E:\Television\Dark Angel\Season 2\Dark Angel - 2-03. Proof of Purchase

See http://www.videodb.info/forum_en/index.php?topic=1168.0
[Thanks, Patch. We're here. ;) ]

You use a similar format to me, add similar regex before the standard ones
I uses season directories of the form "s1" but you use "season 1"
So you will need to replace my "\\s(?P<season>[0-9]{1,2})\\" with with your "\\season (?P<season>[0-9]{1,2})\\" 
Note leave out the bounding quotes
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: rick.ca on June 06, 2009, 06:16:05 am
Patch beat me to it, but I'm moving your topic anyway. I was wondering who might be brave enough to keep a regex topic moving. I should have known. ;D
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: darichman on June 06, 2009, 08:33:49 am
:-[ Should have looked a bit further!

Thanks guys, this thread has given me a lot of useful info :)
*goes off to try and learn regex*
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: rick.ca on June 06, 2009, 09:20:35 am
Quote
*goes off to try and learn regex*

That's what I wanted to hear! Please explain it to me when you're done. ;)

To be a little more helpful... I think you'll find your own "custom" expression(s) will work perfectly—as long as your file path names are consistent.
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: nostra on June 06, 2009, 01:24:39 pm
Easy ;)

Code: [Select]
(?i)^.*\\(?P<origtitle>.*).?-.?(?P<season>[0-9]{1,3})-(?P<episode>[0-9]{1,3})\..?(?P<eptitle>.*)\..{1,4}
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: rick.ca on June 06, 2009, 01:54:18 pm
Oh no! What have you done! Usually when darichman goes off to try and learn something, he comes back the resident expert. You should at least insist he explain your expression before he shamelessly uses it. ;)
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: nostra on June 06, 2009, 02:02:11 pm
OK, darichman, you heard Rick. You need to explain my RegEx now :)
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: darichman on June 28, 2009, 04:43:05 am
Haha, just saw this! I certainly haven't come back an expert :( I went off and did a bit of reading and then applied my tried and tested "trial and error approach" and got it working. With help from patch's example. Only to come back and see Nostra solved it for me anyway ;) I have all my TV shows in PVD now and am just figuring out the best sources for the info. I prefer thetvdb.com's episode lists and release dates, but naturally IMDb has the most comprehensive metadata and the episode numbers don't always match up. Decisions, decisions.

And only four weeks away from finals :-\
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: rick.ca on June 28, 2009, 05:28:21 am
Mastering regex is an excellent way to prepare your mind for any exam. Also, dropping an incomprehensible expression here and there in your paper is an effective way to psych-out the marker. ;)
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: Tethien on January 26, 2010, 04:15:08 am
I have a lot of TV series with only one season and the file name like :

Bad.Love.E01.HDTV.X264.720p-Encoder.mkv
Bad.Love.E02.HDTV.X264.720p-Encoder.mkv
.....

Then VDB can't auto recognition that as one movie.

Please help me.
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: patch on January 26, 2010, 06:02:57 am
I have a lot of TV series with only one season and the file name like :

Bad.Love.E01.HDTV.X264.720p-Encoder.mkv
Bad.Love.E02.HDTV.X264.720p-Encoder.mkv

This will not be recognized by the series scanner / regEx as it has no series number only an episode number.
To fix it you must first decide what you are going to change.
1) Rename your files to a standard format such as (a few other variants are also supported)
   <Series name> s01e01 <ignored text>.<std file extension>
    Note this can be semi automated if you files already have some structure, alternatively pasting the correct prefix can also be fast for a few files.
2) Modify the regex expressions in PVD to match your convention. Doing this involves deciding what is unique/consistent about your naming convention which the pvd regex can look for. Bearing in mind you do not want PVD to start classifying all your multi file movies as series.
For example I file my TV series as
<series directory>/<series name>/s1/<approximate series name><series number><episode number><ignored text>.<file extension>
So if "/s1/" or similar is found one directory up from the media file, I can be sure this is a TV series and I only need to find the episode number in the file name. Note I do not expect you to have the same convention, but you will have to be clear about what your convention is (consistent across all files you will be scanning. Next you will need to read a little about regex, it is confusing at first but is an efficient text search language. I recommend making a text file with examples of all the file path & naming conventions used in your collection. You can then rapidly experiment with a variety of regex expression using a text editor supporting regex such as EditPad pro (http://www.editpadpro.com/download.html) Demo.
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: rick.ca on January 26, 2010, 06:28:47 am
Quote
2) Modify the regex expressions in PVD to match your convention.

Note this does not appear to be a solution in this particular case. Tethien also needs to respect the fact a season must be recorded, even it's an arbitrary season 0 or 1. So the easiest solution, and perhaps the only one, is to add an "S00" or "S01" to the filename of such episodes.
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: patch on January 26, 2010, 06:58:55 am
this does not appear to be a solution in this particular case. Tethien also needs to respect the fact a season must be recorded
If this data exist in the file path then it does not have to be repeated in the file name (hence my request for him to clarify what his convention is and my example using file path information).

However I agree, in the long term it is likely to be much easier to name series files with Series name, series number, & episode number all in the file name as expected by the current pvd regex expressions.

I suspect the file renaming tools you use rick (bat file creation or Directory Opus (http://www.videodb.info/forum_en/index.php?topic=1670.0)) would help Tethien the most.
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: rick.ca on January 26, 2010, 07:28:43 am
Quote
If this data exist in the file path...

I'm confident he would have told us if it were. ;)

But point taken. The season can be anywhere in the pathname (if a regex statement that can find it is provided). But it has to be somewhere.
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: Tethien on January 26, 2010, 11:57:10 am
Thanks for yous reply.
But:
-My film only have one season. And parent directory name is film title. Not have any season number in path.
-I don't know how ? but if i rename the filename like that :
Bad.Love.HDTV.X264.720p-Encoder.E01.mkv
Bad.Love.HDTV.X264.720p-Encoder.E02.mkv

and then PVD recognized OK. Why ?

I  can rename multi file by using Total Commander but if i rename i shuld re-rename back while reseed requested.

Sorry for my bad Englist.
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: patch on January 26, 2010, 12:38:04 pm
My film only have one season. And parent directory name is film title. Not have any season number in path.

If your series has only one season then it is the first season. So name it
Bad Love E01E01.HDTV.X264.720p-Encoder.mkv
Bad Love E01E02.HDTV.X264.720p-Encoder.mkv

All will then run smoothly
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: rick.ca on January 26, 2010, 12:40:38 pm
Quote
and then PVD recognized OK. Why ?

It's not recognized okay. It's recognizing only Title="Bad Love HDTV X264 720p-Encoder E01" instead of Title="Bad Love," Season="1" and Episode="1." Unless Season and Episode are properly recognized, the file will be added as a separate movie record, instead of a nested series record.

You need to understand the function of the regex statements at Preferences - File Scanner. Perhaps you can find a reference source in your native language—like this Wikipedia entry (http://en.wikipedia.org/wiki/Regex). Is it available in your language (listed in left column)?

Quote
I  can rename multi file by using Total Commander but if i rename i shuld re-rename back while reseed requested.

Yes, this is probably what you'll need to do—if you want to use the file scanner to add these files. You could leave the file name unchanged, and add it to PVD manually. Just add the new record, then enter the File path.
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: Tethien on January 27, 2010, 07:49:56 am

Yes, this is probably what you'll need to do—if you want to use the file scanner to add these files. You could leave the file name unchanged, and add it to PVD manually. Just add the new record, then enter the File path.

This is realy a very boring job.

Thank for you help.
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: xyster on March 09, 2010, 03:32:04 am
Yay, my time to jjoin in the regex  fun.

I  havent worked with regex for a couple of years now. So this should be a fun at it. I've read this thread and hope i get it now :D

My files are all named quite consistently... for the most part. I am having trouble getting it to distinguish between moves like this.

Wild.Wild.West.1999.DVDRip.XViD.iNT.CD1-JoLLyRoGeR : Title.Title.Title.YEAR.Quality.notuseful
Taken.WS.R5.XViD-PUKKA                                       : Title.QualityVariant.Quality.notuseful
Bangkok.Dangerous.R5.LINE.XviD-COALiTiON               : Title.Title.Quality.Quality.notuseful
Futurama.Benders.Big.Score.DVDRiP.XviD-OPT             : Title.Title.Title.Title.Title.Quality.notuseful (this is the most common naming format, or the first option).

Thats about all the variation i have in my files.

Is it easiest to just set my regex to read til it hits a predefined Quality type? I know all the values it will eventually hit (R5, R5.Line, DVDSCR, DVDRIP, AC3.DVDRIP, SCREENER, WS.R5, TC, TS, BDRIP)

Also, where does the quality of the file get read in, i dont see it as an option. Or does it happen somewhere else?

So something like...
(?i)^.+\\(?P<title>[^\\]+)[^\\]+(?P<year>(19|2\d)\d{2})   - This predefined one should catch the 1st option and im confident in that.

(?i)^.*\\(?P<title>.*)\\(R5|R5\\.LINE|WS\\.R5|DVDSCR|DVDRIP|etc|etc).\..*   - should be matching the 2nd/3rd/4th type? (i cant seem to tell if you need to add the \\ to escape a "." whilst inside the |...| areas)

Sorry to be a pain, i know how aggivating it is to interpret someones regex stuff. Also thanks for any help guys.
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: buah on March 21, 2010, 07:57:44 pm
RegSearch is really interesting to me. I had an idea to exchange regexps here, but first I wanted to contributed somehow. Being extremely busy at the moment (sorry nostra and rick), I need help if someone is willing to help me.

This is the format of my folders and videos:

"English Title" - "Original Title" ("Year") ("Category") ["Source"],

without qoutes.
Please, note spaces, 5 at all.

Possible examples of naming my folders (and videos) are:

The Matrix (1999)

Is Anybody There^ (2008) (^ is equivalent for ? - the question mark)

Hachiko-- A Dog's Story (2009) (-- is equivalent for : - the colon)

Savage Messiah (1972) [TVRip]

Men Who Hate Women - Män som hatar kvinnor (2009)

A Single Girl - La fille seule (1995) [HS-DVDRip]

Mom at Sixteen (2005) (TV)

Erotic Diary of an Office Lady - OL kanno nikki-- Ah! Watashi no naka de (1977) (V) [HS-DVDRip]


So, I need an expression that will fill in Title field, Original title field (if any), Year, Category (if there are brackets after Year's closing bracket) and Custom field named "Source" (if any) while "[" and"]" have to be recognized as Source only if after a Year or Category (because of the movie [REC] (2007), for example). Or, whatever is possible to fill in, and rest to ignore.

I know it's too much, but any help would be appreciated a lot! Thank you in advance.
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: nostra on March 21, 2010, 08:26:44 pm
1. You can't get category, quality or custom fields using regexps.
2. "Original Title" ("Year") should be processed correctly with default regexps.
3. for "English Title" - "Original Title" ("Year") ("Category") ["Source"] you need:
Code: [Select]
(?i)^.*\\(?P<title>.*) - (?P<origtitle>.*) \((?P<year>[0-9]{4})\).*
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: buah on March 21, 2010, 10:23:18 pm
Tnx nostra, it works great!!!

Hoping that I'm not taking you too much time, just two more things.

1. Is it possible to get ID from the name, cause actually I forgot that the full syntax of my folders (and videos) is:
"ID" - "English Title" - "Original Title" ("Year") ("Category") ["Source"]

2. Is it possible and how to replace "^" with "?", and "--" with ":" wherever it occurs in the name?

I really feel ungrateful now, because I forgot to ask this in my previous post. I guess it happened cause I've been working during weekend as well, and making a lot of reports.

Cheers
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: nostra on March 21, 2010, 11:50:56 pm
Quote
1. Is it possible to get ID from the name, cause actually I forgot that the full syntax of my folders (and videos) is:
"ID" - "English Title" - "Original Title" ("Year") ("Category") ["Source"]

No. Only these fields: title, original title, year, season number, episode number, episode title

Quote
2. Is it possible and how to replace "^" with "?", and "--" with ":" wherever it occurs in the name?

Yes, you have a "Find and replace" table at the bottom of File scanner preferences for this.
Do not forget to escape ? and ^ with \.
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: buah on March 22, 2010, 09:23:39 am
Tnx once again. It all works like a charm.
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: buah on March 22, 2010, 11:40:43 pm
OK, my head exploded.

1. I want to match \d{5}\s-\s ("04523 - ", for instance) which is at the start of the string and not to capture it, but to capture everything after that match, which is what nostra gave me two posts above. Example:

05013 - Antichrist (2009)

I want to capture only <title> and <year>. First 8 characters are always \d{5}\s-\s

2. Nostra, it seems that your regex can't capture movie [REC] (2007)?

Please!
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: nostra on March 23, 2010, 12:14:18 am
1. I want to match \d{5}\s-\s ("04523 - ", for instance) which is at the start of the string and not to capture it, but to capture everything after that match, which is what nostra gave me two posts above. Example:

05013 - Antichrist (2009)

I want to capture only <title> and <year>. First 8 characters are always \d{5}\s-\s

Code: [Select]
(?i)^.*\\.*- (?P<title>.*) \((?P<year>[0-9]{4})\).*
Quote
2. Nostra, it seems that your regex can't capture movie [REC] (2007)?

There is no original title here, so you need:

Code: [Select]
(?i)^.*\\(?P<title>.*) \((?P<year>[0-9]{4})\).*
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: buah on March 23, 2010, 12:11:11 pm
Tnx, I need now only to handle situation when there are both title and origtitle. I hope I'll figure it out somehow.

But...

Quote
2. Nostra, it seems that your regex can't capture movie [REC] (2007)?

There is no original title here, so you need:

Code: [Select]
(?i)^.*\\(?P<title>.*) \((?P<year>[0-9]{4})\).*

... it seems that the problem with the [Rec] (2007) (http://www.imdb.com/title/tt1038988/) movie is how to escape "[" and "]" and make them literal. Also, I have on my mind .45 (2006) (http://www.imdb.com/title/tt0259822/) movie, or Tristan + Isolde (2006) (http://www.imdb.com/title/tt0375154/) movie, for example.

They all contain meta-characters in title, that need to be escaped?
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: nostra on March 23, 2010, 02:31:10 pm
Quote
They all contain meta-characters in title, that need to be escaped?

You escape characters in a regular expression, but not the result of it's work... In your case there is no need to escape smth.
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: buah on March 23, 2010, 06:15:27 pm
Dough!

Nostra, although it doesn't work for me, please ignore me until I'm better concentrated. I mean it ;D

[attachment deleted by admin]
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: nostra on March 23, 2010, 08:45:29 pm
NMM only suggests original title (I do not know why I did it like this any more, to be honest)
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: buah on March 24, 2010, 07:41:04 am
Oh, I thought NMM also would give me the same result as scanner.

As I said earlier, scanner works perfectly. Thank you and sorry for wasting your time, honestly.

So, this is regexp that works for my movie naming convention

"ID" - "Title" - "Original Title" "(Year)" "Whatever-but-to-be-ignored"

Quote
(?i)^.*\\.*- (?P<title>.*) - (?P<origtitle>.*) \((?P<year>[0-9]{4})\).*

[attachment deleted by admin]
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: STEPHAN on October 10, 2010, 03:02:13 pm
Hi,

I am using OTR (OnlineTvRecorder.com). This is a website that lets you record and download German TV. I live in the US ....

Personal Video Database was recommended in their forum.

My (their) film files are in this format:

Gangs_of_New_York_08.02.23_20-15_pro7_180_TVOON_DE.mpg.HQ.cut.avi
Der_Dummschwaetzer_10.09.26_20-15_rtl2_105_TVOON_DE.mpg.HQ.cut.avi
Krieg_der_Welten_08.02.24_20-15_pro7_135_TVOON_DE.mpg.HQ.cut.avi
Der_Schakal_08.02.08_20-15_rtl2_135_TVOON_DE.mpg.HQ.cut.avi
Projekt_Peacemaker_08.02.01_20-15_pro7_135_TVOON_DE.mpg.HQ.cut.avi
King_Tut_Der_Fluch_des_Pharao_08.02.02_20-15_pro7_180_TVOON_DE.mpg.HQ.cut.avi


That’s Title, Date it was send, Time it was send, TV Station, Length of the whole broadcast (including advertising) "TVOON" , quality of the recording, if advertising was cut out etc.

So, only the Title really matters. If I manually search using the title everything works okay (using German Film Databases of cause). Now I am trying to get the Regular Expression for this created, but I don't know anything about it and its hard to get started for me – even with the website recommended here.

Any help would be greatly appreciated.

Thanks

Stephan

Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: rick.ca on October 10, 2010, 11:43:03 pm
Welcome, Stephan.

(?i)^.*\\(?P<title>.*)(_[0-9]{2}\.[0-9]{2}\.[0-9]{2}_).*\..{3,4}

will handle this pattern. This illustrates what is probably the most common regex technique in this application. The fixed pattern of the date is recognized by (_[0-9]{2}\.[0-9]{2}\.[0-9]{2}_). Having this, the title is always whatever is between the last "\" and the date. The "_" in the title are replaced by " " by a Find & Replace rule. Whatever is after the date can be ignored. The same technique can be used where a title is followed by a fixed pattern of year or season and episode number(s). The .*\..{3,4} after the date means "any number of any character until a '.' followed by 3 or 4 characters." That could probably just as well be .*\.avi, but this will work for any file type.
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: nostra on October 10, 2010, 11:46:41 pm
Do not know if you already noticed it, but I have uploaded an app to help writing regular expressions for PVD:
http://www.videodb.info/bin/pvdrt.zip

You still need to write the expression , but it is much easier to test it with this app.
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: rick.ca on October 11, 2010, 12:24:12 am
Quote
but it is much easier to test it with this app.

Indeed, it is. I suggest you add a button to Preferences>File scanner to call this. It's perfect for those of us who do everything by trial & error. ;)
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: nostra on October 11, 2010, 12:41:26 am
Quote
I suggest you add a button to Preferences>File scanner to call this.

I could, acutally. The problem is that I do not plan shipping the app with the installation package, but I think I could add such button if RegEx Tester is located in PVD directory.
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: rick.ca on October 11, 2010, 12:49:40 am
Quote
I do not plan shipping the app with the installation package

If you were to include a button, why not?
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: STEPHAN on October 11, 2010, 12:53:25 am
First of all thanks for all this help being offered, I am impressed !

I am a software developer, so I am usually not that stupid. However I have never worked with Regular Expressions.

I still can' recognise any files, so I might be doing something completely wrong.

I added this RegEx to the configuration of the filescanner and moved it up so it is first.

Then I select the option from the menu (or press CTRL-F) and select the directory were all the files are ... and he does not find any files.

Am I doing it correct ?

Great that you developed this tool. How should I use it ?

(http://koenig.us/skpvd.jpg)
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: nostra on October 11, 2010, 12:59:56 am
Enter the full path of the file in the "Test string" field.

A great regex tutorial is available here: http://www.regular-expressions.info/tutorial.html
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: STEPHAN on October 11, 2010, 01:51:32 am
Enter the full path of the file in the "Test string" field.

Great, that works.

Now I need to figure out how the films get recognized by PDV.

Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: rick.ca on October 11, 2010, 02:10:39 am
Quote
Am I doing it correct ?

Yes, it should work.

Is .AVI still in your list of recognized file types? Is there anything in your ignore list that would exclude the files? Have the files you're testing already been added to the File path field of their respective records?
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: STEPHAN on October 11, 2010, 02:21:31 am
I can add single files and he now even recognized the film titel correct.

I somehow thought that I could add a number of films at the same time, but I does not work. I have also set the option and the directory to scan the directory at the start of the program.




I am having a few other troubles and I can crash the program, but thats seams to be something else. Also this does not look right ;-)

(http://koenig.us/selectmovie.jpg)

Is there a way to switch to english to help you debug it better ?
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: STEPHAN on October 11, 2010, 02:24:36 am
After a crash and a restart it now seems to work.
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: nostra on October 11, 2010, 07:06:48 pm
Quote
Now I need to figure out how the films get recognized by PDV.

What do you mean?
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: STEPHAN on October 11, 2010, 07:13:15 pm
It now works fine.

Thanks for all your help with the Regular Expressions.


Stephan
Title: Re: 0.9.9.x File Scanner and Regular Expressions
Post by: Labbetass on March 27, 2011, 12:04:19 pm
Hi,

I'm new to pvdimport and to this forum. Thanks for this great program! It works great with my .iso rips for movies.

But I don't understand the regular expressions. I'm trying to file scan my tv series, but I can't get the expression right.
They are stored like this:

f:\Media\Tv-serier\Dexter\Season 01\Dexter-S01E12-BornFree.mkv

Can someone please help me with the correct expression for this?

In advance thanks,
Title: Re: File Scanner and Regular Expressions
Post by: rick.ca on October 02, 2011, 04:49:46 am
Welcome to the forum.

Quote
Can someone please help me with the correct expression for this?

(?i)^.*\\(?P<title>.*)-S(?P<season>[0-9]{1,2})E(?P<episode>[0-9]{1,2})

should do it. Use (link to download) utility to test regular expressions for extracting movie data from file names (http://www.videodb.info/bin/pvdrt.zip) to help in finding the expressions you need.
Title: Re: File Scanner and Regular Expressions
Post by: JoopvB on August 03, 2012, 08:23:14 pm
Hi,

I am new to PVD and the forum.

I have a lot of TV series, all neatly named (I use TV rename for that, great prog.). The format of the file name is: series-name - SxxRyy - episode-name (all info from the TVDB.com, that's where TV rename gets it from). From what I have read on this forum (and by trial and error), the TVDB plugin is not really giving good results (or maybe I am not using it correctly; please advise). So I use the IMDB plugin, which 1) gives me all the seasons and 2) per season the detail info per episode.

The regexp I use is: (?i)^.*\\(?P<title>.*) - (s|\b)(?P<season>[0-9]{1,2})e(?P<episode>[0-9]{2,3}) - (?P<eptitle>.*)\..{3,4}.
The switch "Smart episodes detection" is set.

What happens is that for nearly all episodes the dialog comes up with a selection of movies with a comparable name - one of which is the "title" "episode" I am looking for. My question is, why is this? Since the title (show name) is known I expect it would be possible to shorten the dialog list (and in 90% of the cases eliminate it, since only one choise is left).

Am I doing something wrong (or inefficient)? Or is it on a todo list? Or (very possible) is it just a stupid question of some guy of PVD newbie.

Thanks for a great program; by far the best I have seen in this field!
Title: Re: File Scanner and Regular Expressions
Post by: rick.ca on August 03, 2012, 10:30:56 pm
Welcome.

Quote
Am I doing something wrong (or inefficient)?

Inefficient, perhaps, not wrong.

Not having URL's for episodes, the plugin is requesting a search by Title. I don't know why it doesn't get the episode URL's when the series is added in the first place. Or, if that's not feasible, why it can't get the episode Titles and URL's from a summary page. The search is very annoying. If it is necessary, I wish it were restricted to exact matches of Title, automatically accept any single hit, and otherwise fail. Picking from such a list is a waste of time.

I've found the annoyance is minimized if I first, when adding the series, run the TVDb plugin. It always downloads a package with all available data about the series—including episodes. That, of course, doesn't add IMDb URL's, but having the episode records created and properly named seems to help the IMDb plugin find the correct episodes. After running the TVDb plugin, select all the episodes of a season and run the IMDb plugin. If I still get the search dialog and the correct episode is not at the top of the list, I just skip that episode, add the URL manually, and then run it again on that episode.

Notice I haven't said anything about the file scanner or regex. The matching of files to database records is a completely separate matter. Creating and updating the records doesn't require matching the files, and it's more efficient to do this first. Once there are accurate episode records for the series in the database, a properly configured scanner will have no difficulty matching the files.
Title: Re: File Scanner and Regular Expressions
Post by: JoopvB on August 04, 2012, 12:31:57 am
Hi Rick,

Thanks for your prompt reply.
Let me check if I understand what you're saying (and what I am thinking / wondering):

1) The TDV plugin does a search by Title (as does TV rename). This would return the TVDB seriesid (and if we could store that somewhere like the IMDB number that would set us off, I guess?).
2) TDV allowes you to get an overall overview of all episodes of a show (something like: http://thetvdb.com/?tab=seasonall&id=73200&lid=7). So if that is used by the plugin (is it?) I would end up with a complete overview of all episodes of the show.
3) TV rename also pulls out the artwork if available per season and per episode. Hence it must be possible. But if I understand it correct the plugin doesn't (as yet) support this?

So, with the plugin as is, the procedure is: run TVDB plugin on the show (I did, but the title matching came up with nothing); then run IMDB per season to get the details (I do, but I run IMDB as step 1 also). The net effect of what I do is the large number (from my point unnecessary) entries in the dialog. By this I mean that when the dialog list is build, checking it with the known Title of the season would eliminate nearly always all other options in the dialog list, resulting in one (the correct one) that could be chosen automatically.

I understand your point about the filename and the database record. The question there was how do I get a correct record in the database given that I use my filename (see format in the previous post) as the input. From the little I know of regex my guess was that the expression would correctly result in a valid title/season/episode and hence a valid record in the database. Would you agree?

To wrap it up: TV rename seems to do a nice job naming files based on TVDB (the source code is available). A great program like PVD could benefit from an approach like TV rename is using to get the series handling done easier(i.e. getting large numbers of records in the database without much handwork). TV rename just scans all folders, looks up show name, season, episode from TVDB and downloads all TVDB information. With that it can update the filenames and stores images and other episode data in XML.

Maybe I have it completely wrong or am I lacking the knowledge, so excuse me but I really like to understand. Thanks.
Title: Re: File Scanner and Regular Expressions
Post by: rick.ca on August 05, 2012, 02:07:58 am
Just to be clear, I'm not the developer, nostra is. I can only tell what I've learned from using the program. Bear in mind this is the hobby effort of one individual, and the TVDb plugin is one of many. Also, as good as it is for some things, it's not a source everyone will need or want to use. It, or other software that uses it exclusively (like TV Rename) are not likely to be model for all aspects of handling series.

Don't ask me how (I haven't tried it myself), if TV Rename writes sidecar data files, you might be able to import those using the Text file import plugin. There's also a plugin or script for importing local images (perhaps just posters), but I'm less sure how practical that might be.

I use Sick Beard for handing series. Like TV Rename, it's open source and no longer actively supported, but it works. And while I'm not familiar with TV Rename, it may do more. It looks for torrents of new episodes, works with my torrent client to download them, renames and moves them, and gets all the TVDb data (including images)—all automatically. Even so, I don't find it too difficult to maintain the same information in PVD using the plugin. It won't get the episode images, but they're generally crappy anyway. I prefer to let PVD automatically create some screenshots. I then choose one to use as a poster, and delete the rest. I suppose the other reason I don't mind this approach is I need to run the IMDb plugin to get the people data anyway. I run both as a batch for updating episodes.

My point is, I could suggest PVD do what Sick Beard does, or to be integrated with it so they can be used seamlessly together. I don't, because I don't expect others to adapt to my personal preferences—including those who use TV Rename or something else. What's important is that it provide the tools necessary to adapt to any reasonable situation. It can create series records using several sources and add data from sidecar files. It's file scanner can easily match episode files named by any systematic naming routine.

Quote
run TVDB plugin on the show (I did, but the title matching came up with nothing); then run IMDB per season to get the details (I do, but I run IMDB as step 1 also).

I'm not sure, but maybe the better result I get is from running the TVDb plugin first. :-\

Quote
The question there was how do I get a correct record in the database given that I use my filename (see format in the previous post) as the input.

Don't use the filename as input! It only takes a moment to Add a series by entering it's name and running the plugin. Once the series records are created, the file scanner will properly match the files.
Title: Re: File Scanner and Regular Expressions
Post by: JoopvB on August 05, 2012, 02:17:11 pm
Hi Rick,

Get your point. So it's up to the TVDb plugin to become more powerful. One remark... it would be nice to be able to enter the TVDB series number (as it does for IMDB) to help the plugin do it's job and, if PVD would have some unused field in the database, to store it for future references (like it does for IMDB).

Thanks for your help.
Title: Re: File Scanner and Regular Expressions
Post by: rick.ca on August 05, 2012, 08:56:23 pm
I don't know why it doesn't save the URL in the URL field like other plugins. Perhaps because the plugin API doesn't use it—but it's still useful as a link (I add it manually). If the plugin would just do that and get the default poster instead of all of them, it would be a huge improvement.
Title: Re: File Scanner and Regular Expressions
Post by: JoopvB on August 06, 2012, 08:24:29 am
Yes, I agree. It would be great if multiple URL's were possible giving each "lookup" plugin it's own field to do it's job. And we could even have the possibilty to find out what information came from where (by storing a reference to that field). Maybe something for nostra's next release?
Title: Re: File Scanner and Regular Expressions
Post by: rick.ca on August 06, 2012, 12:45:00 pm
Quote
It would be great if multiple URL's were possible giving each "lookup" plugin it's own field to do it's job.

As I indicated, URLs are normally saved in the URL field. Separate fields are unnecessary. I suspect the TVDb URL is not saved because the plugin doesn't use it.
Title: Re: File Scanner and Regular Expressions
Post by: JoopvB on August 06, 2012, 09:28:09 pm
I see, so multiple URL's are saved in one field; OK. Must be the plugin. Thanks.
Title: Re: File Scanner and Regular Expressions
Post by: WoozyB on November 12, 2013, 05:33:58 am

Hi there, I've looked through here and did a search but:

Is there a way to use the file scanner but only to get individual file info?  I don't want them to be grouped by seasons/episodes, as these aren't all TV shows.  I want to have one long basic list of single titles, even if some are similarly named or are in the same folder.

Thanks!
Title: Re: File Scanner and Regular Expressions
Post by: oli70 on January 17, 2014, 09:33:10 am
I'm trying to use PVD to archive my football matches.
The sintax of files is

Champions League - 201213x01 - F_Bayern Munich - Borussia Dortmund.

Questions:

Season Field can be long 6 or more bytes ?

Can i use a string value for Episode ?
(Example Champions League - 201213xF -Bayern Munich - Borussia Dortmund)

Witch is the String for use these string ?

I use the standard one, but is not ok for season long 6.

(?i)^.*\\(?P<title>.*) - (s|\b)(?P<season>[0-9]{1,4})x(?P<episode>[0-9]{1,4}) - (?P<eptitle>.*)\..{3,4}

(?i)^.*\\(?P<title>.*) - (s|\b)(?P<season>[0-9]{1,6})x(?P<episode>[0-9]{1,4}) - (?P<eptitle>.*)\..{3,4}
dont' work!

Thx
Title: Re: File Scanner and Regular Expressions
Post by: nostra on January 17, 2014, 01:54:20 pm
Quote
(?i)^.*\\(?P<title>.*) - (s|\b)(?P<season>[0-9]{1,6})x(?P<episode>[0-9]{1,4}) - (?P<eptitle>.*)\..{3,4}
This seems to work fine here. Try moving this RegEx up in the list.
Title: Re: File Scanner and Regular Expressions
Post by: oli70 on January 17, 2014, 05:44:15 pm
Boh...

File name:

"NFL - 199798x02 - NFCCH_CAR@GB.mkv"

is catalogued only "NFL"

with the string
(?i)^.*\\(?P<title>.*) - (s|\b)(?P<season>[0-9]{1,6})x(?P<episode>[0-9]{1,4}) - (?P<eptitle>.*)\..{3,4}

with
(?i)^.*\\(?P<title>.*) - (s|\b)(?P<season>[0-9]{1,4})x(?P<episode>[0-9]{1,4}) - (?P<eptitle>.*)\..{3,4}

and file name
"NFL - 1997x02 - NFCCH_CAR@GB.mkv" all is OK!
Title: Re: File Scanner and Regular Expressions
Post by: nostra on January 17, 2014, 06:40:34 pm
I think the problem here is not the RegEx, but the fact the file scanner ignores season numbers having such high values. I could change that in the next update, but I am afraid it may take some time.
Title: Re: File Scanner and Regular Expressions
Post by: oli70 on January 20, 2014, 10:46:11 am
If you can...
Thank you.

Can you make another change ?
Accept the Seasons with alphanumeric values (example 1996/97), and the episode number with alphanumeric values (Example for anime Series - 1xOAV1 - Title)

Thanks and sorry for my english
Bye

In fact:

Champions League - 1996/97x01 - Arsenal - Real Madrid
Gundam - 1xOAV1 - Title name
Title: Re: File Scanner and Regular Expressions
Post by: nostra on January 20, 2014, 04:29:11 pm
This would mean significant changes in database structure and queries. Maybe it is better to use another field for the text data? What do those characters in seasons and episodes mean?
Title: Re: File Scanner and Regular Expressions
Post by: oli70 on January 20, 2014, 05:11:53 pm
I know...
For season is not important!

199697 or 1996/07 is the same!

For episode you may catalog some episode with alphanumeric character (for catalog OAV, for example)

You can have...
Season 1
Season 2
Season 3

Season extra (Film, OAV, Special).
For the same anime
(Ad Example Gundam or Holly e Benji)

Holly e Benji (Capitan Tsubasa) has 1 season (128 episode), and 13 OAV.

I dont' know how to catalog the OAV

Thanks a lot
Title: Re: File Scanner and Regular Expressions
Post by: nostra on January 20, 2014, 05:16:29 pm
Would it be OK to have season NUMBER, episode NUMBER and a separate "Episode Type" TEXT field which will contain such values as OAV, Film, Special etc.?
Title: Re: File Scanner and Regular Expressions
Post by: oli70 on January 21, 2014, 09:36:00 am
Wonderful!!
The BEST!

If you can make the change, send us a correct syntax of file names and the Regular Expression.

Thanks a lot!

Bye
Title: Re: File Scanner and Regular Expressions
Post by: ferofrantisek on May 14, 2015, 04:38:12 pm
In all modesty and humility I would like to ask if you, Nostra,  could add text field or multiselect list field or CustomField (with any name that you can use) where can i insert with RegExps data. I know that i can use  <title> <origtitle> <eptitle> <year>  <episode> <season> <imdbid> but i have organized video files in folders for example:
G:\Anime\Sword Art Online (720p Dual 10bit CRF24 DF)\[DarkFlames] 01 - The World of Swords.mkv .... 25 episode.
G:\Anime\Sword Art Online (BD 1080p Dual 10bit CRF23.5 dn92)\[dn92] Sword Art Online - 01 [Dual][BD][1080p].mkv ....  25 episode.
(?i)^.*\\(?P<title>.*)\ \((?P<????>.*)\)\\
Title: Sword Art Online
???? : BD 1080p Dual 10bit CRF23.5 dn92

I want to use in addition to the Title, (Original title and Year - if any) and all text in brackets in some text field (or multiselect list field) in the skin. Because in the brackets are very important information regarding quality, encoding and who encoded. (BD 1080p Dual 10bit CRF23.5 dn92). As you can see there are two versions of the same work/anime therefore, this specification will help me identify them. It does not care that there will be two identical Title names found in database or better if it could be resolved in some other way which will be in one record Title of the movie/anime both entries in brackets in some different fields. BD 1080p Dual 10bit CRF23.5 dn92, 720p Dual 10bit CRF24 DF  It would be good if it was accessible file path for both versions of the files/folders of files. I am open to any proposal how would it be better. For me the most important thing that I had stored record in brackets. I would be very grateful if you could find any solutions and helped me. Thank you very much for your work, willingness and effort.
With respect and appreciation, František
Title: Re: File Scanner and Regular Expressions
Post by: nostra on May 16, 2015, 04:09:42 pm
Unfortunately, the functionality you ask for needs a lot of changes regardless of the way I do this. Having the development of the app on hold now due to the lack of free time on my side, I do not think I can offer you a solution any time soon.
Title: Re: File Scanner and Regular Expressions
Post by: ferofrantisek on May 17, 2015, 12:33:24 am
Thank you for your fast answer although I am very, very, very sad of it. Maybe later comes to your mind some simple solution with the adjustment of the program in order to transfer the previously mentioned data in brackets through Regexps to some field. I will wait and hope. I have a tremendous amount of anime and mechanical copy data in brackets I see it as a bad solution. Let's all ok, so you have more free time. Thanks for everything.
Title: Re: File Scanner and Regular Expressions
Post by: VVV_Easy_Programing on May 23, 2015, 01:47:16 pm
If you want to pass information from the file name to a field you can do it with a very simple script.
Look inside the message "http://www.videodb.info/forum_en/index.php/topic,3965.0.html (http://www.videodb.info/forum_en/index.php/topic,3965.0.html) "Script: Some small programming scripts for Ideas (Easy Script)" the script "Several_File_Infos.psf" for inspiration.

PS: Nostra, we had miss you. Many thanks for the program.