l3uddz / plex_dupefinder

Find and delete duplicate files in Plex
GNU General Public License v3.0
304 stars 54 forks source link

UnionFS #5

Closed sbcrumb closed 5 years ago

sbcrumb commented 6 years ago

When using UnionFS and Google drive this will not actually delete the file from the system just removes it from Plex Database. So if you ever do a manual scan it will find all the dupes.

l3uddz commented 6 years ago

thats why you use a script of some sort to remove those hiddens from google, e.g. cloudplow

l3uddz commented 6 years ago

2018-06-12 22:01:42,080 - INFO       - pushover             - __init__                       - Initialized Pushover notification agent
2018-06-12 22:01:42,080 - INFO       - cloudplow            - <module>                       - Started in upload mode
2018-06-12 22:01:42,185 - INFO       - cloudplow            - do_hidden                      - Starting hidden cleaning
2018-06-12 22:01:42,186 - INFO       - unionfs              - __files                        - Found 2 hidden files in '/mnt/local/.unionfs-fuse'
2018-06-12 22:01:42,186 - INFO       - unionfs              - __folders                      - Found 0 hidden folders in '/mnt/local/.unionfs-fuse'
2018-06-12 22:01:42,186 - INFO       - unionfs              - clean_remote                   - Cleaning 2 hidden file(s) from remote: gdrive
2018-06-12 22:01:45,966 - INFO       - unionfs              - clean_remote                   - Removed file 'gdrive:/Media/Movies/Battle Los Angeles (2011)/Battle Los Angeles (2011) - Bluray-1080p.x264.DTS-battlelosangeles1080.mkv'
2018-06-12 22:01:48,899 - INFO       - unionfs              - clean_remote                   - Removed file 'gdrive:/Media/Movies/Women Who Kill (2016)/Women Who Kill (2016) - WEBDL-1080p.x264.AC3-FGT.mkv'
2018-06-12 22:01:48,900 - INFO       - unionfs              - clean_remote                   - Completed cleaning hidden(s) from remote: gdrive
2018-06-12 22:01:48,900 - INFO       - unionfs              - clean_remote                   - 2 items were deleted, 0 items failed to delete
2018-06-12 22:01:49,601 - INFO       - notifications        - send                           - Sent notification with Pushover
2018-06-12 22:01:49,601 - INFO       - unionfs              - remove_local_hidden            - Removed 2 local hidden file(s) from disk
2018-06-12 22:01:49,677 - INFO       - unionfs              - remove_empty_dirs              - Removed empty directories from '/mnt/local/.unionfs-fuse'
2018-06-12 22:01:49,677 - INFO       - cloudplow            - do_hidden                      - Finished hidden cleaning
2018-06-12 22:01:49,677 - INFO       - decorators           - timer                          - 'do_hidden' from 'cloudplow.py' finished in 7 seconds
2018-06-12 22:01:49,677 - INFO       - cloudplow            - do_upload                      - Starting upload
2018-06-12 22:01:50,074 - INFO       - notifications        - send                           - Sent notification with Pushover
2018-06-12 22:01:50,416 - INFO       - uploader             - upload                         - Uploading '/mnt/local/Media' to remote: gdrive
2018-06-12 22:01:50,751 - INFO       - process              - execute                        - 2018/06/12 22:01:50 INFO  : Google drive root 'Media': Modify window is 1ms
2018-06-12 22:02:05,139 - INFO       - process              - execute                        - 2018/06/12 22:02:05 INFO  : Google drive root 'Media': Waiting for checks to finish
2018-06-12 22:02:05,139 - INFO       - process              - execute                        - 2018/06/12 22:02:05 INFO  : Google drive root 'Media': Waiting for transfers to finish
2018-06-12 22:02:50,772 - INFO       - process              - execute                        - 2018/06/12 22:02:50 INFO  :
2018-06-12 22:02:50,857 - INFO       - process              - execute                        - Transferred:   1.774 GBytes (30.096 MBytes/s)
2018-06-12 22:02:50,857 - INFO       - process              - execute                        - Errors:                 0
2018-06-12 22:02:50,857 - INFO       - process              - execute                        - Checks:                 0
2018-06-12 22:02:50,857 - INFO       - process              - execute                        - Transferred:            0
2018-06-12 22:02:50,858 - INFO       - process              - execute                        - Elapsed time:      1m0.3s
2018-06-12 22:02:50,858 - INFO       - process              - execute                        - Transferring:
2018-06-12 22:02:50,858 - INFO       - process              - execute                        - *   ...1) - Bluray-1080p_Proper.x264.DTS-ba.mkv: 18% /9.841G, 35.627M/s, 3m51s
2018-06-12 22:03:50,752 - INFO       - process              - execute                        - 2018/06/12 22:03:50 INFO  :
2018-06-12 22:03:50,752 - INFO       - process              - execute                        - Transferred:   4.281 GBytes (36.427 MBytes/s)
2018-06-12 22:03:50,752 - INFO       - process              - execute                        - Errors:                 0
2018-06-12 22:03:50,752 - INFO       - process              - execute                        - Checks:                 0
2018-06-12 22:03:50,752 - INFO       - process              - execute                        - Transferred:            0
2018-06-12 22:03:50,753 - INFO       - process              - execute                        - Elapsed time:      2m0.3s
2018-06-12 22:03:50,753 - INFO       - process              - execute                        - Transferring:
2018-06-12 22:03:50,753 - INFO       - process              - execute                        - *   ...1) - Bluray-1080p_Proper.x264.DTS-ba.mkv: 43% /9.841G, 45.285M/s, 2m5s```
sbcrumb commented 6 years ago

I use cloudplow also but the files are still on my google drive. I want to remove them from my google drive mount.

l3uddz commented 6 years ago

plex is running on the same system as cloudplow? or its separate systems?

sbcrumb commented 6 years ago

Everything is on one box

l3uddz commented 6 years ago

it should be creating hidden files, iguess when it deletes a file, check the .unionfs-fuse folder to see if you see it in there. then id check cloudplow logs to see what its saying r.e. cleaning hiddens

sbcrumb commented 6 years ago

It created the .hidden. but the files never get removed from my google drive.

l3uddz commented 6 years ago

check cloudplow logs to see what it says / what its trying to remove. i imagine its failing there

sbcrumb commented 6 years ago

2018-06-11 14:25:57,560 - INFO - cloudplow - do_hidden - Starting hidden cleaning 2018-06-11 14:25:57,573 - INFO - unionfs - files - Found 18 hidden files in '/mnt/local/ .unionfs-fuse' 2018-06-11 14:25:57,577 - INFO - unionfs - folders - Found 3 hidden folders in '/mnt/local /.unionfs-fuse' 2018-06-11 14:25:57,578 - ERROR - cloudplow - do_hidden - Exception occurred while cleaning hid dens: Traceback (most recent call last): File "/opt/cloudplow/cloudplow.py", line 314, in do_hidden hidden_remote_config = conf.configs['remotes'][hidden_remote_name] KeyError: 'kickcrypt' 2018-06-11 14:25:57,579 - INFO - cloudplow - do_hidden - Finished hidden cleaning 2018-06-11 14:25:57,579 - INFO - decorators - timer - 'do_hidden' from 'cloudplow.py' finis

l3uddz commented 6 years ago

theres the error... its looking for a remote called kickcrypt in the remotes section of cloudplow config

sbcrumb commented 6 years ago

I think I need to change that to google. even though my remove it called kickcrypt so I am going to change that and retry once this scan is done.

l3uddz commented 6 years ago

yeah...

it will look at "hidden_remote": "box:", inside the specified remote config to determine which remote to use when it comes to deleting the file

sbcrumb commented 6 years ago

Thank you let me give this a go and see what happens.

sbcrumb commented 6 years ago

@ l3uddz I finally got it deleting proper etc. One thing I noticed was I had a few plex server converts from MKV to MP4 and it removed the MKV's and keept the mp4's I would think MKV would be the file kept over MP4's. I didn't change anything out of the default settings. Am I missing something? Here is the Config.

{ "AUDIO_CODEC_SCORES": { "Unknown": 0, "aac": 1000, "ac3": 1000, "dca": 2000, "dca-ma": 4000, "eac3": 1250, "flac": 2500, "mp2": 500, "mp3": 1000, "pcm": 2500, "truehd": 4500, "wmapro": 200 }, "AUTO_DELETE": true, "FILENAME_SCORES": { ".avi": -1000, ".ts": -1000, ".vob": -5000, "1080pBluRay": 15000, "720pBluRay": 10000, "HDTV": -1000, "PROPER": 1500, "REPACK": 1500, "Remux": 20000, "WEBCasStudio": 5000, "WEBKINGS": 5000, "WEBNTB": 5000, "WEBQOQ": 5000, "WEBSiGMA": 5000, "WEBTBS": -1000, "WEBTROLLHD": 2500, "WEBVISUM": 5000, "dvd*": -1000 }, "PLEX_SECTIONS": { "Movies": 1, "TV Shows": 2, "Kids TV Shows": 5, "Kids Movies": 4 }, "PLEX_SERVER": "PLEX_TOKEN": "REDACTED", "SCORE_FILESIZE": true, "SKIP_LIST": [], "VIDEO_CODEC_SCORES": { "Unknown": 0, "h264": 10000, "h265": 5000, "hevc": 5000, "mpeg1video": 250, "mpeg2video": 250, "mpeg4": 500, "msmpeg4": 100, "msmpeg4v2": 100, "msmpeg4v3": 100, "vc1": 3000, "vp9": 1000, "wmv2": 250, "wmv3": 250 }, "VIDEO_RESOLUTION_SCORES": { "1080": 10000, "480": 3000, "4k": 20000, "720": 5000, "Unknown": 0, "sd": 1000 } }

xman0980 commented 6 years ago

u might want to remove your plex token.

desimaniac commented 6 years ago

It does't look at the extension only the codecs it uses.

If you want it to prefer one extension over the other, then add them to FILENAME_SCORES.