Code for removing movies with deleted files (1 Viewer)

mswiege

MP Donator
  • Premium Supporter
  • October 15, 2008
    35
    12
    Home Country
    Germany Germany
    Hi!

    I'm using MediaPortal for quite a while now and love that it is open source so I (C++/C# developer) can customize it myself if I come up with something.
    Now I added a functionality that I missed for quite a while and am very surprised why it never got already included to an release:
    If you (like myself) have many movies stored on disk and use the "Movie" section of MediaPortal a lot you sooner or later come up to the problem to always have manually keep your movie database clean because movies (files) you delete from your hard disk get not removed from the movie database and therefor still will be shown in your MediaPortal until you delete the entry manually from the configuration program.
    I now simply added a button to the "Scan" tab at the "Movie Database" section of the configuration program like this:
    movie.gif

    After clicking the button the program scans all movies in the DB and checks if all files associated to the movie still exist on the disk. If one or more movies with missing video files are found a list with the found movies is presented to the user:
    movie2.gif

    From this list the user can select which movies should be deleted from the DB (at the beginning all movies are selected by default).
    After clicking on "OK" the selected movies get removed from the db and you have a nice and clean database with only movies that really exist on your disk.
    movie3.gif


    To add this feature you can unzip the attached file to the "Configuration" folder of the MediaPortal folder.
    It contains the modified MovieDatabase.cs (based on current RC3 SVN) which has the new button included and the click handler of the button.
    For the subdialogs folder the DlgMovieMissingFiles.cs file exists that is used for the presentation and selection of the found movies.
    All the code should confirm with your coding guidelines

    Perhaps someone of the developers likes to add this feature (I know that 1.0 is currently feature freezed, but this is a really simple extra that can help a lot). If it is possible that I could become a registered developer of MediaPortal myself, I would be happy to commit the changes myself and will also assist in the future with my coding skills.

    Greetings!
    Maik
     

    Ramjet99

    Portal Member
    June 22, 2007
    32
    0
    WELLINGTON
    Home Country
    New Zealand New Zealand
    Hi Maik, I'm keen to use this as my DB is well clogged after renaming and moving movie files but i cannot find the 'configuration' folder. Can you specify the path where it should be?
     

    mswiege

    MP Donator
  • Premium Supporter
  • October 15, 2008
    35
    12
    Home Country
    Germany Germany
    The folder exists in the source code. You will have to compile the program using Visual Studio yourself.

    Maik
     

    mswiege

    MP Donator
  • Premium Supporter
  • October 15, 2008
    35
    12
    Home Country
    Germany Germany
    compiled Version

    If you just want to use the feature and don't want or can't compile it on your own, I attached a compiled configuration.exe (build on current RC3) to this post. Just copy it over your existing file in your programs directory.

    Have fun.
    Maik
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    mhm your patch does not work for me - i get some missing assembies - errors - and normally the patch file should include the two other files...
     

    Users who are viewing this thread

    Top Bottom