How to prevent removal of "deleted" files from the DB?

Discussion in 'My TVSeries' started by Scythe42, November 15, 2011.

  1. Scythe42
    • Premium Supporter

    Scythe42 Retired Team Member

    Joined:
    June 20, 2009
    Messages:
    2,065
    Likes Received:
    2,632
    Gender:
    Male
    Occupation:
    Professional Hacker
    Location:
    Berlin
    Ratings:
    +2,724 / 1
    Home Country:
    Germany Germany
    Show System Specs
    In my setup I have symlinks to Network Shares, so all the episodes appear to be local to TVSerives. If the network ressource is not available, episodes get removed from the database on the next update scan. Perfectly OK. But not for my symlink setup...



    How can I turn off the general "automatic removal of deleted episodes" in TV Series?
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. Scythe42
    • Premium Supporter

    Scythe42 Retired Team Member

    Joined:
    June 20, 2009
    Messages:
    2,065
    Likes Received:
    2,632
    Gender:
    Male
    Occupation:
    Professional Hacker
    Location:
    Berlin
    Ratings:
    +2,724 / 1
    Home Country:
    Germany Germany
    Show System Specs
    I checked the DB itself for a solution...

    What are the Options "removable" and "keep_references" in the table "ImportPathes" doing?

    Looks like I can solve my issue with these, but I want some more input on them. Not in try&error mood tonight :D
     
  4. Sebastiii
    • Team MediaPortal

    Sebastiii Development Group

    Joined:
    November 12, 2007
    Messages:
    16,270
    Likes Received:
    6,221
    Gender:
    Male
    Location:
    France
    Ratings:
    +10,229 / 9
    Home Country:
    France France
    Show System Specs
    Yeah :) i didn't have the answer but long time no see :) i hope you are well :)
     
  5. ltfearme
    • Premium Supporter

    ltfearme Community Plugin Dev

    Joined:
    June 10, 2007
    Messages:
    6,466
    Likes Received:
    4,261
    Gender:
    Male
    Occupation:
    Software Test Engineer
    Location:
    Sydney
    Ratings:
    +5,410 / 0
    Home Country:
    Australia Australia
    Removal is handled automatically, if your drive goes offline e.g. you unplug your USB drive or if your network is down then the local references are NOT removed. Something else is happening in your case, not sure what but it appears to tvseries that the import path is online but files dont exist (this is the only time we remove them, which is perfectly valid I think).
     
  6. Scythe42
    • Premium Supporter

    Scythe42 Retired Team Member

    Joined:
    June 20, 2009
    Messages:
    2,065
    Likes Received:
    2,632
    Gender:
    Male
    Occupation:
    Professional Hacker
    Location:
    Berlin
    Ratings:
    +2,724 / 1
    Home Country:
    Germany Germany
    Show System Specs
    Exactly that is my problem. This "feature" breaks when inside the import path symlinks are used to resources that might not be always be online. The assumption that if an import path is online, everything inside it is online as well is somewhat "flawed".

    So the question remains: how can I turn this behavior off for an import path? Will "removable" and/or "keep_references" will do the trick for me?
     
  7. RoChess
    • Premium Supporter

    RoChess Extension Developer

    Joined:
    March 10, 2006
    Messages:
    4,186
    Likes Received:
    1,305
    Ratings:
    +1,684 / 2
    The other question is, why do you try to hold on to symlinks when you can add those as UNC paths to MP-TVSeries and everything will work fine?
     
  8. Scythe42
    • Premium Supporter

    Scythe42 Retired Team Member

    Joined:
    June 20, 2009
    Messages:
    2,065
    Likes Received:
    2,632
    Gender:
    Male
    Occupation:
    Professional Hacker
    Location:
    Berlin
    Ratings:
    +2,724 / 1
    Home Country:
    Germany Germany
    Show System Specs
    Poor man's distributed file system :) I'm not holding on to them, I upgraded to them!

    In fact the problem will arise with any distributed file system implementation where the import path is online but directories or files in it might not. Try it out with AD's DFS. It will have the exactly same issue.

    Here is the long story:

    The symlinks allow me to have one single import path and move resources around the network or harddrives as I please with no impact on TVSeries. This is user friendly (my GF would kill me if she had to constantly play with the Config Tool.) With Fuse I even can do more great stuff.

    Some ressources are also located in the cloud or archived and cannot be imported or accessed by TVSeries itself. They will be made online once a file in the directory is accessed. From an application level it looks like one local filesystem or one remote share, even though it isn't. Resources inside it can go on- and offline by accident or on purpose. Any kind of automatic deletion screws things up very bad in such an advanced setup.

    I also insert new episodes directly into the database as part of the post processing from sickbeard to make them available at once without any user interaction or delay. The local scan just updates the artwork later. In fact I will try to "virtualize" the DB in the future. Still need to investigate what the best approach is and if it is even possible.

    Also some ressources are encrypted with TrueCrypt and require an USB Token to be inserted in the HTPC to decrypt then. Think very advanced and actually working parental controls here. No one can access such files without a token.

    I even have replication over VPNs setup to supply some of my closest friends with a "subscription service" to the TV shows of their choice. In addition some shows are held locally and older ones (depending on disk-space) are automatically exchanged to links to my archive drives or cloud ressources.

    I go even further in my setup. I "virtualized" my MP install with symlinks. I can switch between a production, test, development and SVN environment with a single mouse click. Also the DBs and Config Files are symlinks as well depending on who is the user for MP. The setup is standard and the paths are always configured the same for every environment and every user. Think support here. All by just keeping the content inside the poor man's distributed file system flexible and have "trigger actions" setup when specifics folder on my network are accessed or updated.

    I can simply switch out anything real easy without MP or the plugins even noticing while keeping a standard setup and no one needs to change the configuration when something on the network changes. I can work on the network, move resources, replicate them and my GF or some friends at a different location don't have to adjust their configuration when I completed some work. Also different people have different shows in different languages listed in TVSeries depending on their preferences. Still working on a "on-the-fly config reload" while MP is running...

    As you ca see I have perfectly valid reasons to use a DFS based on symlinks and Fuse in my setup.

    To sum it up once again:

    Ressources inside an import path that itself is considered online by TVSeries might not be available for "external" reasons when you use a distributed file system. Therefore I want to turn the deletion behavior off. Can this be done with some of the settings in the DB on the import path? Or do I have to comment out the deletion in the source and recompile it just to turn this behavior off?

    Edit:
    Also a simple mountvol (same a mount under Unix) will have the same problem with mounted Shares to a directory inside an import path. Mountvol exists since Windows XP...
     
    • Like Like x 1
  9. ltfearme
    • Premium Supporter

    ltfearme Community Plugin Dev

    Joined:
    June 10, 2007
    Messages:
    6,466
    Likes Received:
    4,261
    Gender:
    Male
    Occupation:
    Software Test Engineer
    Location:
    Sydney
    Ratings:
    +5,410 / 0
    Home Country:
    Australia Australia
    We don't have the option keep local files anymore. We could however add an advanced option for this case.
     
  10. Scythe42
    • Premium Supporter

    Scythe42 Retired Team Member

    Joined:
    June 20, 2009
    Messages:
    2,065
    Likes Received:
    2,632
    Gender:
    Male
    Occupation:
    Professional Hacker
    Location:
    Berlin
    Ratings:
    +2,724 / 1
    Home Country:
    Germany Germany
    Show System Specs
    That would be awesome!
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!