Automatically updating AMC database when new files are added... (1 Viewer)

OrionHall

Portal Pro
September 13, 2007
198
31
London
Home Country
United Kingdom United Kingdom
Hi All,

I've been working on a little windows app to automatically update the AMC database file based on my main movie collection folder. I don't know if anyone else needs such a thing but I've made it available just in case! Media Portal with MyFilms has been working really well for me, but I wanted to just dump new movie files in my main archive and have them show up automatically.

The tool scans a defined location for compatible files; checks your AMC .xml file to see if they're listed; and adds them if not. It's also scriptable so you can have it run on startup or by a remote control etc. Plus it uses MediaInfo.dll to grab the basic file details such as codec, runtime, resolution etc.

One big catch - I've read a few postings on here from people who store complete DVD images on their hard disks and access them via MediaPortal. This program is based on all movies have unique file names (including support for multi-part films such as 'title 1of2.avi'!) but can't cope with duplicates. Sorry.

If anyone's interested please feel free to have a play - a compiled app (requires .Net Framework 2) and source code (vb.net) are available on SourceForge ...

http://sourceforge.net/projects/amcupdater

It should be fairly self-explanatory, but I've put a few 'FAQs' on SourceForge as well.

Do let me know if anyone finds this useful, or if there's any features you think could be added / improved etc.

Cheers,

Orion Hall

p.s. I'm not a professional coder so please be gentle if you read the source code!
 

Ashius

Portal Member
April 3, 2007
14
0
Home Country
I managed to have a look over the weekend. I had to rebuild the database from scratch and your program worked perfectly! I then realized i forgot a bunch of movies to i ran the program again and it added the new movies flawlessly.

For me this tools makes the MyFilms plugin 100 times easier and more convenient. I never understood why something like this wasn't in ANT to begin with.

Thanks for sharing Orion Hall!

If there is one thing i could suggest for added its a 'find redundant entries' feature. So i can delete movies that i don't want then have amcupdater remove the Ant entries. I don't know how useful it would be to some people but i would love it.
 

yatesd

Portal Pro
April 30, 2007
90
2
54
Does sounds great, I have always been using AVList before but would be nice to get some even more automatic. I will try it tonight.
 

OrionHall

Portal Pro
September 13, 2007
198
31
London
Home Country
United Kingdom United Kingdom
Hi Ashius,
Thanks for your feedback - glad you like it!

Adding an option to purge entries from the database when the corresponding file isn't found will be very easy. The reason I didn't include this originally is that I have a fair few files stored on DVDs, so for me it would be bad if the updater (which runs on login to my MediaPC) removed the entries for those films.

I also had a similar problem recently with the MyTVSeries plugin - I had left it set to remove entries for missing files, but then had problems with my USB wifi adapter which sometimes failed to connect on bootup. So the system booted, MyTVSeries scanned for the files and practically emptied the database when it couldn't find the files on my server! Disabling that option in MyTVSeries and replacing the horrendous Belkin adapter with a NetGear one solved the problem.

But as I said - it's not difficult and I've just coded most of it. When I have time to give it a proper test I'll upload the modified version.

Cheers,

OH.
 

Ashius

Portal Member
April 3, 2007
14
0
Home Country
oh i had forgotten that part of the program is to run on start-up. I can see why it would be a really dangerous option. oh the thought of wiping out 50 movies cause of a network issue, and re-downloading the info again *shudder*

Maybe it would be an idea to make the purge option a manually option only. For myself, i probably will be only using the program manually anyway, but if it's an command line option it may cause problems for inexperienced users.
 

whatisk

Portal Pro
May 21, 2007
242
12
Brisbane
Home Country
Australia Australia
I have come across a problem with the program.
I have my movies in various subfolders under one main folder.
eg: \movies; \movies\comedy, etc

The first time I imported all my movies, it imported them all fine including those in subdirectories.

When I imported some more, movies in the top level (ie: \movies) imported fine, however those in subfolders did not. They got an entry in the AMC XML file, however there were no titles or media info - the fields were blank.
For the movie, it showed c:\movies\shrek.avi instead of c:\movies\animation\shrek.avi

I am using the URL field for the movie file storage.

Any ideas why this may have happened? Whem running the program, it lists all the movies including those in the subfolders fine as new movies that weren't currently in the database.

If you need any more info, let me know.

Thanks.
 

OrionHall

Portal Pro
September 13, 2007
198
31
London
Home Country
United Kingdom United Kingdom
Hi whatisk,
Sounds like a good bug there! Sounds like it's the bit which compares the existing xml entries against the file system which isn't working properly.

Can you just confirm that you mean that you use the URL field to store the file locations (i.e. c:\movies\animation\shrek.avi)? I added the option to use something other than 'source' for this but probably didn't test it as well as I should have.

Also can you please confirm whether you're using the Override Path option?

I'm currently working on the next version - quite an upgrade as I'm adding multi-threading to the GUI mode of the application. A few of my files cause the MediaInfo dll to hang for ages so I want the GUI to stay responsive and report on progress. I've yet to find any way to get that dll to return an error quickly if it can't cope so this seems to be the only way. Tricky though!

I'll see if I can replicate your problem and will let you know.

Cheers,

OH.
 

whatisk

Portal Pro
May 21, 2007
242
12
Brisbane
Home Country
Australia Australia
Can you just confirm that you mean that you use the URL field to store the file locations (i.e. c:\movies\animation\shrek.avi)? I added the option to use something other than 'source' for this but probably didn't test it as well as I should have.
Sorry if I didn't explain clearly. Yes, I use the URL field to store the file location.
Can't remember exactly why I chose to use it rather than the default Source field.
If there is a quick and easy way to transfer what's in the URL field to the Source field, I could do that. I'm sure there are no issues with using the Source field to store the file locations.

Also can you please confirm whether you're using the Override Path option?
No, I am not using the Override Path option.

Also, it does the same thing regardless of if there is a space in the filename or not.

Cheers.
 

OrionHall

Portal Pro
September 13, 2007
198
31
London
Home Country
United Kingdom United Kingdom
Hi again,

I've set up a test folder structure with lots of subfolders and files - typically when I ran the updater it worked fine for me. I then added a few more files and again, it just added them correctly. Possibly this is because I'm running the latest version which I've been tinkering with.

Can you please try the attached mini-release and see if it's any different? This is the current development copy but it should be functional. I've only included the .exe and .config so just dump these in the old AMCUpdater folder as it'll need the mediainfo.dll which is in there. This version outputs a bit more detail to the logs which would help - if it still has a problem please post your logfile (might be best to delete the old log first for clarity) and I'll have a look.

Cheers,

OH.
 

Users who are viewing this thread

Top Bottom