Music Share Watcher (4 Viewers)

hwahrmann

Development Group
  • Team MediaPortal
  • September 15, 2004
    4,633
    2,457
    Vienna, Austria
    Home Country
    Austria Austria
    Attention: Just incorporated MusicShareWatcher into SVN. Only 0.2 users should download the plugin from the download page

    What it is?

    It is an external Program running in the System Tray that watches the Music Shares as set in MP Configuration (local and lan drives, no CD/DVD or FTP shares).

    Why did i do it?

    With a rather big number of songs it was a bit too time consuming to run an update of the database, via the MP Configuration, every time a new song was added or an existing song was removed/renamed or some tags changed.
    I know that for new songs the Share View could be used, but i'd like to have an Artist / Album view.

    I know that Steve has it on his list. But there are so many items, so i thought i'd help him and i also didn't wait anymore for something like this to come. :D

    What it does?

    The program sits in the System Tray, with monitoring on the shares enabled as default. You can right-click on the icon and temporarily suspend the monitoring or end the program.

    It monitors changes on files and subdirectories in the music shares and updates the MP Music Database.

    It works on all files supported by the Tag reader. So all the Music files that are currently detected will also be processed by this program.

    Monitored events are:

    • - Create: When a file is being copied somewhere into the share, the tags of the file are being read and the Music Database is updated. Artist, Album, etc. are created, if they don't exist already.

      - Change: An existing file has been changed, because of Tags have been updated. The updated Tag information is written into the Music Database

      - Delete: A single file or a complete directory structure is deleted. The songs related to that path are removed. Also Artists, Albums and Genres with no songs are removed.

      - Rename: Either a Directory or a File is being renamed. The Music Database is updated. For a Directory change the Path is corrected.

    Where to find it?

    Submitted a patch to sourceforge. I'm using the standard Database.dll, with some changes for the Music Database made to it.
    So i need Steve to verify my code and decide if he wants to commit it.
    But if you have VS you should be able to compile it yourself.

    Simply have MusicShareWatcher.exe in the MP directory, where Mediaportal.exe itself resides.

    Start it from there or put it into the Autostart folder.
    a log file is written into the "log" dir of mp.

    Backup your Music Database. Just in case. :wink:
    Any suggestions for improvements are welcome.

    Have fun,

    Helmut
     

    garion

    Portal Member
    January 20, 2006
    32
    0
    54
    Bavaria
    Home Country
    Germany Germany
    Hi
    I realy realy like the idea, and was looking for something like it myself, but....

    I would realy like to see it as a real plugin. A fuction you could enable or disable inside of MP, not as an extra programm runing.

    Just my 2cent

    Garion
     

    onkl

    Portal Pro
    February 18, 2005
    341
    0
    48
    Wageningen
    Home Country
    Netherlands Netherlands
    Then again, they may both be useful, since when I'm tagging music or reorganise my collection, Mediaportal is not running (no dedicated HTPC)
     

    jawbroken

    Portal Pro
    August 13, 2005
    706
    0
    Home Country
    Afghanistan Afghanistan
    onkl said:
    Then again, they may both be useful, since when I'm tagging music or reorganise my collection, Mediaportal is not running (no dedicated HTPC)

    Yes, but there isn't any need to update the Music database unless MediaPortal is running (as you won't be looking at the database otherwise). Unless this program only works if you change files while it is running, in which case it wouldn't be nearly as useful as it wouldn't work unless the HTPC is on all the time with this program running and the network it is on is working all the time (which can be an issue with wireless internet, for example).

    EDIT: I guess my question is, does it only synch changes that are done while the tray program is running, or does it look at the entries currently in the music database and compare them against what is in the share?
     

    garion

    Portal Member
    January 20, 2006
    32
    0
    54
    Bavaria
    Home Country
    Germany Germany
    As i understand it, it relays on functions form MP.
    That is why i thought it should be included in mymusic.
    Especialy while it changes the database. So if the code is included in mymusic it is easyer to overlook the consequnces if there are changes in the database structure in the future.

    bg
    Garion
     

    hwahrmann

    Development Group
  • Team MediaPortal
  • September 15, 2004
    4,633
    2,457
    Vienna, Austria
    Home Country
    Austria Austria
    • Thread starter
    • Moderator
    • #7
    the program uses the .Net FileSystemWatcher, so it must be up and running for the changes to be detected.
    If you add a bunch of files without running the program, then you should use MP Configuration to update the database.

    I first thought of doing it as a plugin, but not all users have a dedicated htpc.
    And with the external program approach it doesn't matter if mp is up or not.

    garion: The code to change the database IS in mymusic. i'm even using the same methods for Adding and deleting a song as mymusic does, so this shouldn't be a problem.

    Anyway, let's see the feedback of other users. Should be relatively easy to make a plugin out of it.
     

    zebons

    Portal Pro
    January 2, 2006
    1,484
    114
    hwahrmann said:
    the program uses the .Net FileSystemWatcher, so it must be up and running for the changes to be detected.
    It should be better if we could have stored somewhere the last update date made on the database and compare it with the change date file attribute. So the program could detect all modifications made since the last update without running all the time... :?
     

    hwahrmann

    Development Group
  • Team MediaPortal
  • September 15, 2004
    4,633
    2,457
    Vienna, Austria
    Home Country
    Austria Austria
    • Thread starter
    • Moderator
    • #9
    That's what MP Configuration does, when you select "Update database from selected shares"

    Edit: And in some cases, if you copy a whole directory from one pc to another the file date isn't changed. So how would i know that something has changed?
     

    Users who are viewing this thread

    Top Bottom