Author Topic: File Scanner and Regular Expressions  (Read 128259 times)

0 Members and 2 Guests are viewing this topic.

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: 0.9.9.x File Scanner and Regular Expressions
« Reply #60 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?

Offline STEPHAN

  • Member
  • *
  • Posts: 10
    • View Profile
Re: 0.9.9.x File Scanner and Regular Expressions
« Reply #61 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 ;-)



Is there a way to switch to english to help you debug it better ?

Offline STEPHAN

  • Member
  • *
  • Posts: 10
    • View Profile
Re: 0.9.9.x File Scanner and Regular Expressions
« Reply #62 on: October 11, 2010, 02:24:36 am »
After a crash and a restart it now seems to work.

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: 0.9.9.x File Scanner and Regular Expressions
« Reply #63 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?
Gentlemen, you can’t fight in here! This is the War Room!

Offline STEPHAN

  • Member
  • *
  • Posts: 10
    • View Profile
Re: 0.9.9.x File Scanner and Regular Expressions
« Reply #64 on: October 11, 2010, 07:13:15 pm »
It now works fine.

Thanks for all your help with the Regular Expressions.


Stephan

Offline Labbetass

  • Member
  • *
  • Posts: 1
    • View Profile
Re: 0.9.9.x File Scanner and Regular Expressions
« Reply #65 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,

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: File Scanner and Regular Expressions
« Reply #66 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 to help in finding the expressions you need.

Offline JoopvB

  • Member
  • *
  • Posts: 16
    • View Profile
Re: File Scanner and Regular Expressions
« Reply #67 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!

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: File Scanner and Regular Expressions
« Reply #68 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.

Offline JoopvB

  • Member
  • *
  • Posts: 16
    • View Profile
Re: File Scanner and Regular Expressions
« Reply #69 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.

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: File Scanner and Regular Expressions
« Reply #70 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.

Offline JoopvB

  • Member
  • *
  • Posts: 16
    • View Profile
Re: File Scanner and Regular Expressions
« Reply #71 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.

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: File Scanner and Regular Expressions
« Reply #72 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.

Offline JoopvB

  • Member
  • *
  • Posts: 16
    • View Profile
Re: File Scanner and Regular Expressions
« Reply #73 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?

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: File Scanner and Regular Expressions
« Reply #74 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.

Offline JoopvB

  • Member
  • *
  • Posts: 16
    • View Profile
Re: File Scanner and Regular Expressions
« Reply #75 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.

Offline WoozyB

  • Member
  • *
  • Posts: 1
    • View Profile
Re: File Scanner and Regular Expressions
« Reply #76 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!

Offline oli70

  • Member
  • *
  • Posts: 8
    • View Profile
Re: File Scanner and Regular Expressions
« Reply #77 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

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: File Scanner and Regular Expressions
« Reply #78 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.
Gentlemen, you can’t fight in here! This is the War Room!

Offline oli70

  • Member
  • *
  • Posts: 8
    • View Profile
Re: File Scanner and Regular Expressions
« Reply #79 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!