Closed kaplannn closed 7 years ago
"sort -u" or "uniq" should do the trick :)
where do i have to put that?
thank you! :)
After i add "| sort -u" the script wont be executed anymore....
I fixed it here: https://github.com/ajkis/scripts/blob/master/plex/plexgeneratefolderlist
The thing is you will need to scan for new folders only and | sort should be added before ).
I suggest you use this script instead: https://github.com/ajkis/scripts/blob/master/plex/plexupdatenew.cron
That one is pretty simple since it will refresh only folders newer then 15 minutes eg less chance for anything to go wrong and you can run on Plex server only.
Thank you :)
I used the other script already but the problem was that it took to long to finish the "find" with my big Library...
i updated my script like yours. now its like this:
Adding to plex.list: /home/plex/acd/media/tv Adding to plex.list: /home/plex/acd/media/tv/Crazy Ex-Girlfriend Adding to plex.list: /home/plex/acd/media/tv/Crazy Ex-Girlfriend Adding to plex.list: /home/plex/acd/media/tv Adding to plex.list: /home/plex/acd/media/tv/Supergirl
so it will scan my whole tv Library ): and there are still duplicates
i found a solution. i added this to the scipt:
sort /home/plex/list/$TimeStamp-plex.list | uniq >> /home/plex/list/$TimeStamp-plex2.list
echo "New plexlist:" | tee -a "$LOGFILE" echo "$(cat /home/plex/list/$TimeStamp-plex2.list)" | tee -a "$LOGFILE"
its not beautiful but it does the job :)
ah i update it
make it if [[ $task == "/movies/" ]] || [[ $task == "/series/" ]] && [[ $task != "/mnt/unionfs/movies" ]] && [[ $task != "/mnt/unionfs/series" ]] ; then
I completely remade the generating part so there is no room for errors https://github.com/ajkis/scripts/blob/master/plex/plexgeneratefolderlist
With the latest version, I'm getting the following: Notice the timestamp is missing. I think it's because the variable is set to TIMESTAMP, but referenced as $TimeStamp in the code.
Adding to plex.list: /home/plex/union-acd-upload/tv/Taken (2017)/Season 01 Uploading: -plex.list 2017/04/10 22:17:49 INFO : Encrypted amazon drive root 'encrypted/5a8iuqcn9pcp6kovnvitk512u0': Modify window not supported 2017/04/10 22:17:49 INFO : Encrypted amazon drive root 'encrypted/5a8iuqcn9pcp6kovnvitk512u0': Waiting for checks to finish 2017/04/10 22:17:49 INFO : Encrypted amazon drive root 'encrypted/5a8iuqcn9pcp6kovnvitk512u0': Waiting for transfers to finish 2017/04/10 22:17:49 INFO : -plex.list: Copied (replaced existing)
Here are the contents of -plex.list
more: unknown option -ex.list
Usage:
more [options]
A file perusal filter for CRT viewing.
Options:
-d display help instead of ringing bell
-f count logical rather than screen lines
-l suppress pause after form feed
-c do not scroll, display text and clean line ends
-p do not scroll, clean screen and display text
-s squeeze multiple blank lines into one
-u suppress underlining
-
For more details see more(1).
@deliverer33, the timestamp issue should be fixed here: https://github.com/ajkis/scripts/pull/15#issue-221063642
As for the second issue. You're seeing that message because the filename starts with '-' your text editor thinks that -plex.list is a param you're passing.
correct. It's working fine now.
I'm using your plexgeneratefolderlist/plexrefreshlist scripts. It's working pretty well so far :)
If i'm downloading a whole season plex there will be multiple same paths in the plex.list
Example:
/local/The 100/Season 3/E1.mkv /local/The 100/Season 3/E2.mkv /local/The 100/Season 3/E3.mkv
will be in list:
/fuse/The 100/Season 3 /fuse/The 100/Season 3 /fuse/The 100/Season 3
so it will scan the season folder as much as it has episodes
Could you add something to avoid multiple season paths? (I'm not an scripter :/)