Delete duplicate entries (1 Viewer)

HTPCSourcer

Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    Hi,

    Running movie detection with other grabbers has led to a few duplicate entries. I tried to delete these but probably I am doing something wrong, after each start of MePo they are back.

    Is there an official way to delete any entry without touching the related file on disk?

    Thanks,
    HTPC_Sourcer
     

    Guzzi

    Retired Team Member
  • Premium Supporter
  • August 20, 2007
    2,161
    747
    Hi, - not sure what you mean ... if you have configured to remove entries when media fil(s) are missing, they should be removed automatically.
    There is also a context menu option to delete movies - either only DB record without media file - or including the media file.
    See wiki here about the setup - and be careful not to remove the media file itself :). I didn't use that option since years, as I let the importer remove records for missing media files.
    If you intension is to remove a record to let it import again - then you could simply either "update" the movie from myfilms - or with AMCupdater you may also update a set of records you can define.
     

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    Misunderstanding, files are not missing. I have three files, for which there are two entries in the movie list and I want to delete the double entry.

    • Setup: the "Manual deletion" will lead to both DB entry and file deleted. Automatic will not delete anything.
    • AMC Updater: Under View Movies I select the respective record, delete it, save and close. When I open again the deleted entry is back.
    This is a multi-seat Setup with central database on the main server. I manage everything from one PC, but at the same time other clients may be either on or in standby, i.e. MediaPortal is kind of running on other systems. What I believe to observe is that changes that I do on PC1 will later not necessarily be active.

    So what I just did was to switch off any other instance of MePo, then delete a DB entry via AMC Updater and start MePo again on another client. This time it "accepted" the change.

    What happens if a change to the databse is made on PC1 while MePo is running on PC2, when you then stop MePo on PC2? Will the databse be overwritten with the outdated content of PC2?
     

    Guzzi

    Retired Team Member
  • Premium Supporter
  • August 20, 2007
    2,161
    747
    Misunderstanding, files are not missing. I have three files, for which there are two entries in the movie list and I want to delete the double entry.
    So it is a three part movie and you want all of them in a single movie entry?
    • Setup: the "Manual deletion" will lead to both DB entry and file deleted. Automatic will not delete anything.

    • Depending on the settings, you should be able to select if to e.g. delete only DB record entry - if it is not working it might be a bug - or caused by the issue you described later (DB update 'not accepted') - logs might help to understand what's happening.
      [*]AMC Updater: Under View Movies I select the respective record, delete it, save and close. When I open again the deleted entry is back.
      Might be same reason why 1st option "not working" - see explanation below.
    This is a multi-seat Setup with central database on the main server. I manage everything from one PC, but at the same time other clients may be either on or in standby, i.e. MediaPortal is kind of running on other systems. What I believe to observe is that changes that I do on PC1 will later not necessarily be active.
    So what I just did was to switch off any other instance of MePo, then delete a DB entry via AMC Updater and start MePo again on another client. This time it "accepted" the change.What happens if a change to the databse is made on PC1 while MePo is running on PC2, when you then stop MePo on PC2? Will the databse be overwritten with the outdated content of PC2?
    It seems that this was happening.
    Central setup in general works as follows:
    - Each client when started loads the central DB content into a local cache that serves as data source during runtime.
    - Each client monitors changes of the central DB - whenever there is a change, the client re-loads the central DB to make sure the cached content is "current"
    - On "resume after standby", a reload is initiated to make sure changes on the DB while the client was sleeping will update the cached content ont he client

    - When a client makes changes on the cache content (e.g. a movie set to "seen", local updates to a movie (grabbing), imports, trakt related sync, etc. the client writes those changes back to the server. The client "locks" the central DB for this time to make sure, not two client write-back at the same time.
    - When two clients want to write back at the same time, the one who first attempts to create the lock will write-back - the other would detect the update and first update local cache, then write back

    - Each client only waits for a certain time to write-back - if that timer times out, the change will not be written back to DB - changes might get lost, e.g. when a cache cointent refresh then will be done by update by other client from cemntral DB. This is needed to avoid infinite waiting in lock situations - it is "not perfect" per definition - but usually does not happen too often in reality.

    As you describe, changes you do from one place (e.g. one MF-client - or a workstation where you manage your DB) get lost, when you shutdown a client - that seems to be an indication, that the clients do not update their cache content when you change the (central) DB - and thus might later overwrite central DB with their last status, as the client thinks that is up to date with central DB.

    So I would check the logs of the clients shortly after you made a change to the central DB - you should see something like:
    Code:
    2014-11-22 14:04:40,621  Info [ 10 |       MyFilms ]: WatcherChanged() - New FSwatcher Event: Changed: '\\server\share\db.xml'
    2014-11-22 14:04:47,955 Debug [ 69 |  BaseMesFilms ]: LoadMyFilmsFromDisk() - Current Readlocks: '0'
    2014-11-22 14:04:47,965 Debug [ 69 |  BaseMesFilms ]: LoadMyFilmsFromDisk() - opening '\\server\share\db.xml' as FileStream with FileMode.Open, FileAccess.Read, FileShare.ReadWrite
    2014-11-22 14:05:02,772 Debug [ 69 |  BaseMesFilms ]: LoadMyFilmsFromDisk() - closing  '\\server\share\db.xml' FileStream
    2014-11-22 14:05:02,772 Debug [ 69 |  BaseMesFilms ]: LoadMyFilmsFromDisk() - Finished  (1488 ms)
    2014-11-22 14:05:02,772 Debug [ 69 |  BaseMesFilms ]: CreateOrUpdateCatalogProperties() - add Properties done ... (0 ms)
    2014-11-22 14:05:02,772 Debug [ 69 |  BaseMesFilms ]: CreateOrUpdateCatalogProperties() - Adding CustomFields Definitions done ... (0 ms)
    2014-11-22 14:05:04,257 Debug [ 69 |  BaseMesFilms ]: LoadMyFilmsFromDisk() - Calc PreAcceptChanges ... (148 ms)
    2014-11-22 14:05:04,685 Debug [ 69 |  BaseMesFilms ]: LoadMyFilmsFromDisk() - Calc & CustomField Copy Finished ... (190 ms)
    2014-11-22 14:05:04,685 Debug [ 69 |  BaseMesFilms ]: LoadMyFilms() - Finished ... (success = 'True') (1673 ms)

    You could easily test this by simply saving the central DB file from an editor.

    After a resume you should see somthing like:

    Code:
    2014-11-22 11:48:56,139 Debug [  1 |       MyFilms ]: MyFilms received power event Resume
    2014-11-22 11:48:56,139  Info [  1 |       MyFilms ]: PowerModeChanged() - MyFilms is resuming from standby
    2014-11-22 11:48:56,412 Debug [  1 |       MyFilms ]: PowerModeChanged() - Network not yet ready or DB file not accessible on try '1 of 10' to reload - waiting for next retry
    2014-11-22 11:48:56,966 Debug [  6 |       MyFilms ]: WatcherError() - A FileSystemWatcher error has occurred: Der angegebene Netzwerkname ist nicht mehr verf³gbar
    2014-11-22 11:48:58,432 Debug [  1 |       MyFilms ]: PowerModeChanged() - Network not yet ready or DB file not accessible on try '2 of 10' to reload - waiting for next retry
    2014-11-22 11:48:59,877 Debug [ 27 |       MyFilms ]: MyFilms is connected to the network
    2014-11-22 11:49:00,484 Debug [  1 |       MyFilms ]: PowerModeChanged() - MyFilms is reloading movie data to memory cache.
    2014-11-22 11:49:00,499 Debug [  1 |  BaseMesFilms ]: LoadMyFilmsFromDisk() - Current Readlocks: '0'
    2014-11-22 11:49:00,521 Debug [  1 |  BaseMesFilms ]: LoadMyFilmsFromDisk() - opening '\\server\share\db.xml' as FileStream with FileMode.Open, FileAccess.Read, FileShare.ReadWrite
    2014-11-22 11:49:02,235  Info [  6 |       MyFilms ]: InitFSwatcher() - FSwatcher started watching - DB-file: '\\server\share\db.xml'
    2014-11-22 11:49:02,235 Debug [  6 |       MyFilms ]: WatcherError() - FSwatcher restarted after error !
    2014-11-22 11:49:19,181 Debug [  1 |  BaseMesFilms ]: LoadMyFilmsFromDisk() - closing  '\\server\share\db.xml' FileStream
    2014-11-22 11:49:19,181 Debug [  1 |  BaseMesFilms ]: LoadMyFilmsFromDisk() - Finished  (1882 ms)

    If you're missing those refreshes, the above described problem might occur - again, log should tell us more...
     

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    Thanks for the detailed explanation about the database mechanics. I can now follow up on it if ever I encounter similar issues again.

    So it is a three part movie and you want all of them in a single movie entry?
    No. I really look at one single file on the drive, which I grabbed through a scan. Later I rescanned to complete some missing information, using a different search/match identifier and suddenly had two entries for the same file in the database. The attempt to delete one of them didn't get me anywhere in the beginning.

    Anyway, the AMC Updater changes were accepted this time, so all is good.
     

    Users who are viewing this thread

    Top Bottom