Git Product home page Git Product logo

Comments (1)

m-rots avatar m-rots commented on May 31, 2024

Originally Autoscan had this exact behaviour implemented. Files were checked for their existence before sending any requests to the targets. Each time an existence check was unsuccessful, the min-age would be applied again so the existence could be retried later (up to a configurable limit). However, this behaviour was removed in Autoscan 0.4.0 due to our Google Drive (through Bernard) integration.

Essentially, the problem we began facing was the following:
Autoscan was file-based, each item in the datastore was required to have both a folder path and a file name. So when we send scan requests to targets, we first checked whether the folder path + file name existed on the file system. When successful, we grabbed the folder path and sent it off to the targets (Plex requires a folder to be scanned, not a file).

Now, here comes the problem: Plex only scans a folder when its parent folder exists. Of course this is totally fine when files are added or have changed, but it becomes problematic when entire folders are being deleted. The following case made us remove everything file-related:

  1. Original files lived in /Shows/The Boys/Season 1/episodes.mkv
  2. /Shows/The Boys is renamed to /Shows/The Boys (2019)

Now, at this point we must scan both the new path to add the correct path for the new file entries and the old path to clean up and remove the previous entries. However, we must scan the path /Shows/The Boys as its parent /Shows must still exist for Plex to do anything. Yet, the architecture we were using (the folder path + file name) caused us to forget the original event (that /Shows/The Boys is deleted) and instead only told us that a few specific files were removed (with no insight of the total number of files). Therefore, Autoscan tried to scan the path /Shows/The Boys/Season 1 to remove the items. But as you can imagine, it did not work as the parent /Shows/The Boys did no longer exist.

With this issue in mind and the only up-side of saving file paths being file existence, we removed the file-based architecture completely and instead moved on to folders exclusively. This has fixed our issue and this will continue to be the way the architecture is designed for Autoscan moving forward.

  • The change from folder+file based to exclusively folder based: Folders of Madness
  • The release where this change made its way into Autoscan officially: 0.4.0

from autoscan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.