How to prevent removal of "deleted" files from the DB? (1 Viewer)

Scythe42

Retired Team Member
  • Premium Supporter
  • June 20, 2009
    2,065
    2,703
    50
    Berlin
    Home Country
    Germany Germany
    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?
     

    Scythe42

    Retired Team Member
  • Premium Supporter
  • June 20, 2009
    2,065
    2,703
    50
    Berlin
    Home Country
    Germany Germany
    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
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,751
    7,196
    Sydney
    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).
     

    Scythe42

    Retired Team Member
  • Premium Supporter
  • June 20, 2009
    2,065
    2,703
    50
    Berlin
    Home Country
    Germany Germany
    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).
    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?
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    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?
     

    Scythe42

    Retired Team Member
  • Premium Supporter
  • June 20, 2009
    2,065
    2,703
    50
    Berlin
    Home Country
    Germany Germany
    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?
    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...
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,751
    7,196
    Sydney
    Home Country
    Australia Australia
    We don't have the option keep local files anymore. We could however add an advanced option for this case.
     

    Scythe42

    Retired Team Member
  • Premium Supporter
  • June 20, 2009
    2,065
    2,703
    50
    Berlin
    Home Country
    Germany Germany
    That would be awesome!
     

    Users who are viewing this thread

    Top Bottom