Anthirian / script.service.janitor

Janitor is an addon for Kodi that cleans up any watched videos from your hard drive(s) based on various criteria
GNU General Public License v3.0
26 stars 14 forks source link

Ignoring exclusions #80

Closed jgrn307 closed 4 years ago

jgrn307 commented 4 years ago

I have my videos organized into e.g. "movies" and "archived-movies" in different folders via smb mounts. I want Janitor to clean "movies" but not "archived-movies" so I placed the folder in the exclusions -- but Janitor is ignoring them.

I'm not sure how to grab the text of the log from the addon, but I've added two screenshots of this behavior. 20191205_193820 20191205_193906

Any ideas? This used to work great about a year ago but hasn't been working recently.

jgrn307 commented 4 years ago

I realized I posted the same problem previously and never followed up -- it seems like your algorithm is expecting an embedded username and password when I enter the smb info (the shares are authenticated) but I'm not sure how to do that -- when I added the sources I put in the smb path, then kodi asked me for a username/password, so I never had to enter some "weird" string. Alternatively, would you consider adding some "exclusion by source"? I have different sources in kodi for the exclusion vs. not.

Anthirian commented 4 years ago

It would appear that Team Kodi at some point have made a change in the way that the paths are retrieved via the JSON-RPC API, since you are also describing that it used to work like this in the past, and I did not change anything related to this in Janitor's code either.

The weird string you're seeing is the full path to the directory, including the username and password you submitted for that shared folder. I could look into stripping these credentials from the path before I supply the path to the JSON-RPC API for exclusion checks, but that is error prone and may sometimes also yield false positives.

I much prefer your solution of checking the sources that have been configured and then allowing users to select a source they want to exclude altogether, instead of having to select the exact same prefix.

I may implement a fix using the first method. When I have to rewrite Janitor to support Python 3 for Kodi 19 I may try to implement the second method, though that could take a while.