Code Monkey home page Code Monkey logo

Comments (102)

jpartain89 avatar jpartain89 commented on July 28, 2024 6

Its always awesome when you look through a forum to make REALLY SURE a feature request isn't already posted, and you see that your fav idea is an oldie and seems to be wanted by quite a few users!!!

Please, oh please consider adding this ability!

from sonarr.

Beck162 avatar Beck162 commented on July 28, 2024 4

This would be huge!

from sonarr.

spoatacus avatar spoatacus commented on July 28, 2024 3

I actually made a version for sonarr too.

https://gitlab.com/spoatacus/sonarr-episode-trimmer

from sonarr.

tcn33 avatar tcn33 commented on July 28, 2024 2

A barebones version that keeps only X most recent would suffice for most
users, I would think - without the need to look at watched status.

On Thu, Oct 29, 2015 at 9:51 AM, Mark McDowall [email protected]
wrote:

Off the top of my head I know its not even close to the top rated card on
Trello, which would be movies at over 300 right now. We no longer use
Trello though, its only still open to not break existing links.

Votes don't work well for us, most votes went to large features that would
halt development on other aspects of Sonarr, which is somewhat applicable
to this particular feature. Priority is misleading and instead of priority
we should look at complexity as generally complexity is what drives us to
implement a specific feature at a certain time, if I know I have a few
hours to solve a bug or feature I'm likely to pick up something small, I'm
not going to take on something that will take me days to complete.

The complexity in this feature mostly comes on where we're going to get
the watched status from, trakt would provide the simplest integration. but
that requires people to install a plugin in their media player of choice
and want to sync that status to trakt, the other option is to poll every
related media center application and pull that status into Sonarr, which
requires us to dig through documentation (or lack of documentation) to
determine if something has been watched.

This is definitely something we want to implement, but its not going to
happen ASAP.


Reply to this email directly or view it on GitHub
#314 (comment).

from sonarr.

mustacheride avatar mustacheride commented on July 28, 2024 2

I'd support this functionality inside the seasons or show edit page, preferably. Also maybe a checkbox to assign it when adding a new show, so that older shows added don't get the same policy.

from sonarr.

userspaced avatar userspaced commented on July 28, 2024 2

I would love this feature for daily shows. Ideally I'd like to keep at most the most recent 5 episodes only. So when a new one downloads pushing it up to 6, the oldest should get deleted.

from sonarr.

spoatacus avatar spoatacus commented on July 28, 2024 2

I've updated my script to work was a Custom Post Processing Script. Check it out here: https://gitlab.com/spoatacus/sonarr-episode-trimmer.

@seanvree I haven't tested it on Windows, but it should work on any platform.

from sonarr.

explainer avatar explainer commented on July 28, 2024 1

I agree with a 'retention days policy', as a series option. Some daily shows are very topical, and could be dropped after 7-14 days, some series could have entire completed seasons dropped. I don't need a more complex solution involving verifying that an episode has or has not been watched.

from sonarr.

wolrah avatar wolrah commented on July 28, 2024 1

Agreed that a simplified version working purely on a "keep X {days,weeks,months,years,episodes,seasons}" basis configurable per-series would still be desirable in a lot of cases without having to deal with the complexity of tracking watched vs. unwatched. Adding a "do not auto-delete this episode" flag would be nice too, but not absolutely necessary.

from sonarr.

smidley avatar smidley commented on July 28, 2024 1

We need this feature! Just a simple keep X latest episodes would be wonderful.

from sonarr.

 avatar commented on July 28, 2024 1

i apparently echoed the idea of this feature into IRC, so I'm leaving a note here to show my support

from sonarr.

kingmatusevich avatar kingmatusevich commented on July 28, 2024 1

I agree, if you can just keep some X days worth of shows or some Y amount of episodes for a certain shows (generally daily shows) it would be good enough for covering the largest use case scenario.

from sonarr.

spoatacus avatar spoatacus commented on July 28, 2024 1

@nickwolf Run the script from the command line with the --list-series argument.

python sonarr-episode-trimmer.py --config /path/to/config/file --list-series

That will give you a list of all the series in sonarr with the cleanTitle.

from sonarr.

SonarrBot avatar SonarrBot commented on July 28, 2024

Comment from blackkatt on Trello:

yes, totally!

from sonarr.

SonarrBot avatar SonarrBot commented on July 28, 2024

Comment from deadshotomega on Trello:

I've started to delete most of my shows older seasons. I'd love to see an option in nzbDrone that lets me tell it to delete seasons once a new season has started. Effectively keeping only one season at a time! This would be on a per show basis since there's no way in hell I'm deleting Firefly off my HTPC :)

from sonarr.

SonarrBot avatar SonarrBot commented on July 28, 2024

Comment from jakepersona on Trello:

I'd like to see this as an official feature. Maybe have a dedicated folder for "throwaway TV shows" that we only intend on watching once and then deleting.

from sonarr.

SonarrBot avatar SonarrBot commented on July 28, 2024

Comment from tymixon on Trello:

I agree w/ kallaide - support deleteing by season, as well as by time or # of shows. I like options.

And yes, sync w/ trakt so it doesn't delete episodes that are unwatched.

Possibly even make it so that it can check multiple trakt accounts so if you share a plex server out, it won't delete until everyone has watched.

from sonarr.

SonarrBot avatar SonarrBot commented on July 28, 2024

Comment from jeax on Trello:

I'd like this for 'big shows' Like daily news shows, or sports shows. Being able to have the '5 latest' at all times would be amazing functionality that at the moment isn't possible in any of the contending software, yet for anybody that watches lots of these types of programs, its huge.

It's a common feature for podcasts, and on set top boxes. Very useful.

from sonarr.

SonarrBot avatar SonarrBot commented on July 28, 2024

Comment from taloth on Trello:

@mythjuha Something for you? Includes unit tests, adding some UI to Profile, add DecisionEngine Specification to prevent downloading those old ones, and a ScheduledTask to do the periodic cleanup.

from sonarr.

SonarrBot avatar SonarrBot commented on July 28, 2024

Comment from markus101 on Trello:

Preventing RSS from grabbing a release automatically makes a lot of sense. Preventing it on auto search works as long as manual search shows why it was rejected.

Not deleting it if it was grabbed via manual search seems like a big change because we don't even know how an episode was grabbed when it was imported and would be a pretty significant change to many parts of the app. I'm not saying we shouldn't do it, but we should do the work of tracking the "source" of the grab/import separately from this to keep the PR focused and not too massive (like splitting CDH and torrents).

from sonarr.

SonarrBot avatar SonarrBot commented on July 28, 2024

Comment from taloth on Trello:

@markus101 Yes, I concur, shouldn't do all at once. I thought the Grabbed history event might have a flag. But I was confused with the DownloadFolderImport & SeriesFolderImport event types.

from sonarr.

SonarrBot avatar SonarrBot commented on July 28, 2024

Comment from jelv on Trello:

I vote for a "keep X aired episodes and deleted others".

A download "source" to track manually downloaded older episodes to prevent them from being auto-deleted sounds like a good bonus.

I don't feel much for a watched/unwatched state. I like to watch a fresh daily show, but the older episodes I will probably never watch again. A setting like this will save me a lot of space and manual deleting.

from sonarr.

SonarrBot avatar SonarrBot commented on July 28, 2024

Comment from thusband on Trello:

Yes, option to delete a show or a season manually or automatically after it's watched. Delete everywhere too. Sonarr, Plex, hard drive, etc.

from sonarr.

SonarrBot avatar SonarrBot commented on July 28, 2024

Comment from osiris13 on Trello:

If you opt-in an auto-delete option, and have it enabled, perhaps you should be able to mark favorite shows as 'keeper' so they don't get auto-deleted.

from sonarr.

SonarrBot avatar SonarrBot commented on July 28, 2024

Comment from br14nw on Trello:

I'm sure the default would be to keep them unless you enabled the option to set a retention. So there wouldn't be a need to mark them as "keeper."

from sonarr.

SonarrBot avatar SonarrBot commented on July 28, 2024

Comment from nelluk on Trello:

@br14nw I assume he means keep one particular episode of a show that is otherwise being auto-deleted. For example delete any Daily Show episode that is older than 10 days, but mark the one from Wednesday as a never-delete because it has a guest I really like.

from sonarr.

SonarrBot avatar SonarrBot commented on July 28, 2024

Comment from br14nw on Trello:

Ah! I misread that. That makes sense. Good call!

from sonarr.

SonarrBot avatar SonarrBot commented on July 28, 2024

Comment from frostywolf on Trello:

I would love this. Keeping a rolling week of Conan, or the Daily Show, or whatever would be amazing.

from sonarr.

explainer avatar explainer commented on July 28, 2024

I like SonarrBot's checklist above. I need to be able to drop by season, or after n shows.

from sonarr.

bitminerasic avatar bitminerasic commented on July 28, 2024

Please implement this feature (per Sonarrbots list), certainly must be on a per Series basis. This would add one of the most useful PVR type features. I posted a feature request called Auto-Prune but same idea. I've heard same from some of my friends. Diskspace for TVshows can be hard to manage without something like this. Thx in advance!!!

from sonarr.

bitminerasic avatar bitminerasic commented on July 28, 2024

How can we get this bumped up from low priority - it has 55 votes on trello. That's far more votes than anything else I see on trello in any category, low/med/high or even items in development. Most suggestions only have a couple of votes, this one seems that everyone wants/needs in a big way. I think as Sonarr has gotten better and better and easier and easier, harddisks/servers are filling up faster, so this becomes more important the better sonarr gets.

from sonarr.

markus101 avatar markus101 commented on July 28, 2024

Off the top of my head I know its not even close to the top rated card on Trello, which would be movies at over 300 right now. We no longer use Trello though, its only still open to not break existing links.

Votes don't work well for us, most votes went to large features that would halt development on other aspects of Sonarr, which is somewhat applicable to this particular feature. Priority is misleading and instead of priority we should look at complexity as generally complexity is what drives us to implement a specific feature at a certain time, if I know I have a few hours to solve a bug or feature I'm likely to pick up something small, I'm not going to take on something that will take me days to complete.

The complexity in this feature mostly comes on where we're going to get the watched status from, trakt would provide the simplest integration. but that requires people to install a plugin in their media player of choice and want to sync that status to trakt, the other option is to poll every related media center application and pull that status into Sonarr, which requires us to dig through documentation (or lack of documentation) to determine if something has been watched.

This is definitely something we want to implement, but its not going to happen ASAP.

from sonarr.

bitminerasic avatar bitminerasic commented on July 28, 2024

Oh, sorry wasn't trying to overplay the # of votes. i really didn't see any others on trello with more - now I see movies at 300 :) and also a couple of others in the 50 range like this one. most were a lot less. this one seemed to have a lot of votes but had been on the low list for a long time. but agree w tcn33 - I really don't need an autodelete after watch via trakt- although that could be nice. I really just need a basic keep certain # of episodes type of thing like Tivo and directv DVR do. my main concern is filling up the server. would like to keep space managed if possible. the trakt thing sounds nice too, but for me is lower priority. thanks for replying! and thanks a ton for Sonarr, it is awesome.

from sonarr.

br14nw avatar br14nw commented on July 28, 2024

Exactly this. Just a simple retention setting that says "keep x number of
shows" or "x number of days/weeks".

On Wed, Oct 28, 2015 at 6:01 PM tcn33 [email protected] wrote:

A barebones version that keeps only X most recent would suffice for most
users, I would think - without the need to look at watched status.

On Thu, Oct 29, 2015 at 9:51 AM, Mark McDowall [email protected]
wrote:

Off the top of my head I know its not even close to the top rated card on
Trello, which would be movies at over 300 right now. We no longer use
Trello though, its only still open to not break existing links.

Votes don't work well for us, most votes went to large features that
would
halt development on other aspects of Sonarr, which is somewhat applicable
to this particular feature. Priority is misleading and instead of
priority
we should look at complexity as generally complexity is what drives us to
implement a specific feature at a certain time, if I know I have a few
hours to solve a bug or feature I'm likely to pick up something small,
I'm
not going to take on something that will take me days to complete.

The complexity in this feature mostly comes on where we're going to get
the watched status from, trakt would provide the simplest integration.
but
that requires people to install a plugin in their media player of choice
and want to sync that status to trakt, the other option is to poll every
related media center application and pull that status into Sonarr, which
requires us to dig through documentation (or lack of documentation) to
determine if something has been watched.

This is definitely something we want to implement, but its not going to
happen ASAP.


Reply to this email directly or view it on GitHub
#314 (comment).


Reply to this email directly or view it on GitHub
#314 (comment).

from sonarr.

nickheidke avatar nickheidke commented on July 28, 2024

Another bonus might be to add an option to query Plex to see if it the episode is marked as "Watched" before deleting, but, I concur with others, even just a "keep X episodes" would be really helpful!

from sonarr.

thezoggy avatar thezoggy commented on July 28, 2024

i know kodi can do this with plugins (auto prune files after x date/etc), can plex?

from sonarr.

tcn33 avatar tcn33 commented on July 28, 2024

@thezoggy wouldn't that cause Sonarr to redownload deleted episodes because they're "missing"?

from sonarr.

M0UL avatar M0UL commented on July 28, 2024

@tcn33 sonarr has a option to unmonitor deleted episodes.

from sonarr.

br14nw avatar br14nw commented on July 28, 2024

Not if you set it to monitor future only when adding a series.

On Sun, Feb 28, 2016 at 1:39 PM, tcn33 [email protected] wrote:

@thezoggy https://github.com/thezoggy wouldn't that cause Sonarr to
redownload deleted episodes because they're "missing"?


Reply to this email directly or view it on GitHub
#314 (comment).

from sonarr.

nickheidke avatar nickheidke commented on July 28, 2024

@thezoggy unfortunately, plex doesn't support that. I was hoping Sonarr might.

from sonarr.

thezoggy avatar thezoggy commented on July 28, 2024

you could just use sonarr's notifier > custom script. and just run a bash/whatever script to apply the logic .. https://www.google.com/search?q=remove+files+older+than&ie=utf-8&oe=utf-8#

from sonarr.

nickheidke avatar nickheidke commented on July 28, 2024

I can run a windows scheduled task too, just trying to come up with a more
elegant solution :-)

On Sun, Feb 28, 2016 at 5:58 PM thezoggy [email protected] wrote:

you could just use sonarr's notifier > custom script. and just run a
bash/whatever script to apply the logic (go grab kodi's script and just use
that)


Reply to this email directly or view it on GitHub
#314 (comment).

from sonarr.

dave-zack avatar dave-zack commented on July 28, 2024

Would really, really like this. Similar feature to many podcast players (as many folks have said) and great for shows that air daily that you catch when you can.

from sonarr.

thadius856 avatar thadius856 commented on July 28, 2024

Definitely needed!

from sonarr.

glegeza avatar glegeza commented on July 28, 2024

Yep, this is pretty much my most wanted feature at the moment. Simple per-show retention policy based on age (ideally by air date rather than file age, but whatever really) is all that's needed.

from sonarr.

W3Warp avatar W3Warp commented on July 28, 2024

One problem with Trakt, it's not very reliable in my experience. I had it mark watched (whole seasons) that wasn't so. And not unwatch when told too. Having Sonarr delete a whole season by mistake would certainly piss me off hehe.

A better solution might be:
Checking with the media center instead. Most I think have a "watched flag" future. I know Kodi has. And Plex seems too as well.

In the meantime:
An alternative for Windows/Kodi users, All Due, with some minor modifications could work on other setups too? this simple script is avaliable https://github.com/Blackkatt/ToggleThatEpisode

Conclusion:
However, using that solution would make Sonarr dependent on a add-on when it comes to Kodi. And another solution would have to be used for other MC's.
So, querying the Media Center's database instead seems to me the best solution? Or like I've done, get the current playback.

from sonarr.

thezoggy avatar thezoggy commented on July 28, 2024

http://sickbeard.com/forums/viewtopic.php?f=8&t=3460#p15050
https://forums.plex.tv/discussion/84822
https://github.com/spoatacus/sickbeard-episode-cleaner
http://forum.kodi.tv/showthread.php?tid=201312

then there are kodi plugins and cron jobs and so on..

from sonarr.

40wattrange avatar 40wattrange commented on July 28, 2024

This is something I'd love. Even if it was "dumb" and was literally just an age or number of episodes threshold.

from sonarr.

seanvree avatar seanvree commented on July 28, 2024

This would be dope!

from sonarr.

AgileHumor avatar AgileHumor commented on July 28, 2024

Please add this feature.

Having to delete episodes via files system script (keep latest video and nfo file in a directory) AND manually untoggle in Sonarr (that ignore deleted advanced option doesn't work) is a pretty poor solution in my opinion.

from sonarr.

M0UL avatar M0UL commented on July 28, 2024

@AgileHumor ignore deleted files works but you need rescan series for sonarr to see it of wait for sonarr to it automaticly since it refeshes the series every 12 hours.

from sonarr.

FrostyWolf avatar FrostyWolf commented on July 28, 2024

I'd like this for daily news shows, or sports shows. Being able to have the '5 latest' at all times would be amazing functionality that at the moment isn't possible in any of the contending software, yet for anybody that watches lots of these types of programs, its huge.

It's a common feature for podcasts, and on set top boxes. It is unreal that there is no "clean" solution for this in the Sonarr/SAB/Plex universe yet, it seems like a huge ball to be dropping.

from sonarr.

thezoggy avatar thezoggy commented on July 28, 2024

most people just solved this with a script ages ago or use plugins in kodi/plex...

from sonarr.

thezoggy avatar thezoggy commented on July 28, 2024

plex: https://forums.plex.tv/discussion/84822/plex-auto-delete-script
kodi: http://kodi.wiki/view/Add-on:Janitor

3rd party: http://lifehacker.com/341950/belvedere-automates-your-self-cleaning-pc
external tool using sb api: https://github.com/spoatacus/sickbeard-episode-cleaner
(prob could modify this to use sonarr's api?)

but also easy to just cron out if you want, remove files older than 5 days:
find /path/to/directory/ -mindepth 1 -mtime +5 -delete

from sonarr.

thezoggy avatar thezoggy commented on July 28, 2024

but anyways, having the logic in sonarr would prob be nice for some.. as the app knows the concept of seasons and such.. but it'd be easy to go down a rabbit hole of support on what criteria and how to manage when and what it does.. keep latest season? last X episodes? delete older than X days? only kick off if storage size < threshold.. etc etc etc

from sonarr.

FrostyWolf avatar FrostyWolf commented on July 28, 2024

None of those are clean, easy solutions for plex. The script is 3 years untouched and almost all the recent posts are people having one issue or another.

Either a plex plug in that lists your shows and allows you to set number of episodes to keep or days to keep, or a sonnar plug in that does the same would be a perfect solution. It covers both time and rolling number of episodes/seasons, using one of the two environments that already keep track of your shows. An auto delete toggle box, a drop down with days/episodes, and then a form fill for how many days/episodes. It can be in the same menu pane where the delete option is.

We all know that Plex is never going to get around to it and hardly anything gets coded for it for plug-ins, and sonnar already does frequent scans on episode checks that the auto delete can piggy back off of.

On Oct 16, 2016 5:38 PM, thezoggy [email protected] wrote:

but anyways, having the logic in sonarr would prob be nice for some.. as the app knows the concept of seasons and such.. but it'd be easy to go down a rabbit hole of support on what criteria and how to manage when and what it does.. keep latest season? last X episodes? delete older than X days? only kick off if storage size < threshold.. etc etc etc


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

from sonarr.

killerz298 avatar killerz298 commented on July 28, 2024

I too would love this functionality in either Plex or Sonarr. Ever since Jon Stewart left the Daily Show I find myself watching it less and less. I'd love to be able to keep only the most recent 3 episodes.

https://github.com/spoatacus/sickbeard-episode-cleaner is exactly what I am looking for. Will that work with current Sonarr?

from sonarr.

thezoggy avatar thezoggy commented on July 28, 2024

you would just have to change the api calls from sb to sonarr.. and it should work (assuming the same required info is provided back from the needed api calls)

from sonarr.

thezoggy avatar thezoggy commented on July 28, 2024

well there you go @killerz298 dilemma solved thanks to @spoatacus

from sonarr.

nickheidke avatar nickheidke commented on July 28, 2024

@spoatacus how are you kicking this off?

On Mon, Oct 17, 2016 at 6:34 PM, thezoggy [email protected] wrote:

well there you go @killerz298 https://github.com/killerz298 dilemma
solved thanks to @spoatacus https://github.com/spoatacus


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#314 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AEPLgwCjRIX0BD7rb8cnJtNPzbkIrBsAks5q1AX1gaJpZM4GIQ_r
.

Nick Heidke
920-385-9110
[email protected]

from sonarr.

spoatacus avatar spoatacus commented on July 28, 2024

@nickheidke I use a cronjob to run it once a day (like 3-4am).

I want to update it and make it work as a Custom Post Processing Script. I just haven't had the time to do that yet.

from sonarr.

FrostyWolf avatar FrostyWolf commented on July 28, 2024

@spoatacus Custom Post Processing Script version of that would be amazing, it would be the most elegant and simple solution for plex/sonnar users that I've seen.

from sonarr.

killerz298 avatar killerz298 commented on July 28, 2024

I agree. I can't believe this functionality isn't already built in. Seems like such a routine feature. Great work @spoatacus would love to see the final product when you have time.

from sonarr.

seanvree avatar seanvree commented on July 28, 2024

Wow, this is great @spoatacus ! Has anyone tried to run this on windows?

from sonarr.

seanvree avatar seanvree commented on July 28, 2024

@spoatacus ! Thanks! So this is just a CRON job correct? I'll figure it out. I know CRON doesn't work on windows, but I'm assuming there is some other stuff this might work on.

from sonarr.

delphiactual avatar delphiactual commented on July 28, 2024

You windows task scheduler as your crib on windows

from sonarr.

FrostyWolf avatar FrostyWolf commented on July 28, 2024

The version he just published is ment to be run directly from sonnar, regardless of operating system. I would be cool to be a little picture tutorial to help set it up tho. I messed with it for a bit today but I'm apprehensive of deploying a python script that has the ability to delete media. Not that I'm afraid it's malicious, but because I'm the event of a unforseen bug, the last thing I need is any or all of my collection getting wiped out.

I'd feel better if I was 100% certain I was deploying it properly. It looks like you just add it in sonarr, and have it run with the sonarr argument and the config argument to point it at a configuration file you make before hand.

Sent from my Cyanogen phone

On Oct 30, 2016 12:35 AM, delphiactual [email protected] wrote:

You windows task scheduler as your crib on windows


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

from sonarr.

seanvree avatar seanvree commented on July 28, 2024

@spoatacus

Okay, this DOES run perfect on windows from a CMD prompt (using python command), which means it can easily run from windows task scheduler. So that's GOOD!

However, I'm a little confused as to how to make this work using the SONARR WebUI ("add custom script")

I'm assuming the path it the path to the sonarr-episode-trimmer.py file, correct? and the Arguments would be the path to the CONFIG.INI file, correct?

And then, just disable everything except for "ON GRAB"

Just wanting to make sure of this before I accidentally delete all my stuff.

from sonarr.

spoatacus avatar spoatacus commented on July 28, 2024

@FrostyWolf @seanvree I updated the README with instructions on how to set it up as a custom script.

@FrostyWolf I updated the script to not use python to delete any files. I was using it to cleanup metadata files that sonarr would grab, but I didn't realize sonarr will do that for you when deleting an episode. I removed that code, so now the script only uses sonarr's api to delete episodes.

from sonarr.

seanvree avatar seanvree commented on July 28, 2024

@spoatacus

YOU"RE THE MAN!!! Works like a charm on Windows! Fully automated! THANK YOU!

from sonarr.

nickwolf avatar nickwolf commented on July 28, 2024

@spoatacus this is a little embarrassing, but how do I use the Sonarr API to get the CleanTitle?

Thank you for all your work!

from sonarr.

seanvree avatar seanvree commented on July 28, 2024

@nickwolf I had the same question, took me an hour to figure it out.

Are you on windows?

from sonarr.

seanvree avatar seanvree commented on July 28, 2024

Hey @spoatacus ,

I saw this error in my Sonaarr just now:

So, as I previously stated, I can run the script on the windows box that is hosting SONARR from a CMD prompt.

When I run a test on the custom script from SOnarr, it connect fine.

Settings:

PATH: C:\sonarr-episode-trimmer\sonarr-episode-trimmer.py
ARGUMENTS: --config C:\sonarr-episode-trimmer\config.ini --custom-script

"Unable to send OnDownload notification to: sonarr-episode-trimmer: The specified executable is not a valid application for this OS platform"

"System.ComponentModel.Win32Exception (0x80004005): The specified executable is not a valid application for this OS platform.
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at NzbDrone.Common.Processes.ProcessProvider.Start(String path, String args, StringDictionary environmentVariables, Action1 onOutputDataReceived, Action1 onErrorDataReceived) in M:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Processes\ProcessProvider.cs:line 167
at NzbDrone.Common.Processes.ProcessProvider.StartAndCapture(String path, String args, StringDictionary environmentVariables) in M:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Processes\ProcessProvider.cs:line 199
at NzbDrone.Core.Notifications.CustomScript.CustomScript.ExecuteScript(StringDictionary environmentVariables) in M:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Notifications\CustomScript\CustomScript.cs:line 125
at NzbDrone.Core.Notifications.CustomScript.CustomScript.OnDownload(DownloadMessage message) in M:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Notifications\CustomScript\CustomScript.cs:line 84
at NzbDrone.Core.Notifications.NotificationService.Handle(EpisodeDownloadedEvent message) in M:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Notifications\NotificationService.cs:line 132"

from sonarr.

rbabiak avatar rbabiak commented on July 28, 2024

@seanvree If I had to guess I would think you need to adjust according;

PATH: C:\path\to\python\python.exe
ARGUMENTS: C:\sonarr-episode-trimmer\sonarr-episode-trimmer.py --config C:\sonarr-episode-trimmer\config.ini --custom-script

from sonarr.

seanvree avatar seanvree commented on July 28, 2024

@rbabiak Great, made the change, will report if fixed.

THANKX!

from sonarr.

sinewave avatar sinewave commented on July 28, 2024

HI,

So excited to see this script but after trying it out I keep getting this error

Component Message Time sonarr-episode-trimmer.py ConfigParser.NoSectionError: No section: 'API' Yesterday sonarr-episode-trimmer.py raise NoSectionError(section) Yesterday sonarr-episode-trimmer.py File "/usr/lib/python2.7/ConfigParser.py", line 607, in get Yesterday sonarr-episode-trimmer.py params['apikey'] = CONFIG.get('API', 'key') Yesterday sonarr-episode-trimmer.py File "/volume1/homes/john/myapps/sonarr-episode-trimmer/sonarr-episode-trimmer.py", line 32, in api_request Yesterday sonarr-episode-trimmer.py series = api_request('series') Yesterday sonarr-episode-trimmer.py File "/volume1/homes/john/myapps/sonarr-episode-trimmer/sonarr-episode-trimmer.py", line 131, in <module> Yesterday sonarr-episode-trimmer.py Traceback (most recent call last): Yesterday

Full details posted to gitlab: https://gitlab.com/spoatacus/sonarr-episode-trimmer/issues/3

Anyone run into this issue? @spoatacus any ideas?

Running on Synology DSM 5.2

from sonarr.

thezoggy avatar thezoggy commented on July 28, 2024

your config is bad.. No section: 'API'

you are missing the API section in your config.. example:

[API]
url = localhost:8989
key = XXXXX

from sonarr.

seanvree avatar seanvree commented on July 28, 2024

FYI: Script is working great on windows.

from sonarr.

sinewave avatar sinewave commented on July 28, 2024

I have that section:

`[API]
url = localhost:8989
key = j324edd020b50938q93c5fd6d552l73f

[Series]
lastweektonightwithjohnoliver = 3
realtimewithbillmaher = 3
thedailyshow = 3
tosh0 = 3`

from sonarr.

thezoggy avatar thezoggy commented on July 28, 2024

then either your config cant be loaded (permissions)/invalid location.. or you have something before the section thats breaking the file..

from sonarr.

epheterson avatar epheterson commented on July 28, 2024

+1, this feature would be great for daily shows

I setup the script and it works great, thanks!

from sonarr.

dmz94 avatar dmz94 commented on July 28, 2024

+1 on this feature.

Many thanks to @spoatacus for the script!!

from sonarr.

killerz298 avatar killerz298 commented on July 28, 2024

I was playing around in the Plex config options and it looks like this feature is partially built in now. If you go into a show and edit it and go to advanced it will have this option:

"Set the maximum number of unwatched episodes to keep for the show."

For some reason it only has All, 5, 3, and 1 as options. I don't know why they don't just let you type something in there.

from sonarr.

seanvree avatar seanvree commented on July 28, 2024

Seems that Sonarr-Episode-Trimmer is no longer working? Repo seems dead.

https://gitlab.com/spoatacus/sonarr-episode-trimmer

It stopped working a couple weeks ago. Seems the repo isn't supported anymore? Here's the error I'm getting:

C:\sonarr-episode-trimmer>python sonarr-episode-trimmer.py --config C:\sonarr-episode-trimmer\config.ini --list-series
ERROR    303 See Other
ERROR
Traceback (most recent call last):
  File "sonarr-episode-trimmer.py", line 131, in <module>
    series = api_request('series')
  File "sonarr-episode-trimmer.py", line 46, in api_request
    return json.loads(resp_body)
  File "C:\Python27\lib\json\__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "C:\Python27\lib\json\decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Python27\lib\json\decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

C:\sonarr-episode-trimmer>
Using this on windows with Python27

from sonarr.

thezoggy avatar thezoggy commented on July 28, 2024

missing series section?

from sonarr.

seanvree avatar seanvree commented on July 28, 2024

@thezoggy Nope. Didn't change anything from the .ini file...it just stopped working after working for like a year;

[Config]
path = E:\TV

[API]
url = 192.168.1.20:38084
key = ce3722936dca4c868d1d183fddb94c16

[Series]
nbcnightlynews = 5
60minutes = 10
vicenewstonight = 5
lastweektonightwithjohnoliver = 5
vice = 10

from sonarr.

thezoggy avatar thezoggy commented on July 28, 2024

did you delete any of those series from sonarr?

from sonarr.

seanvree avatar seanvree commented on July 28, 2024

@thezoggy nope. all there.

Correct me if I"m wrong, but I don't think it's the config file. If I simply run the python script from a prompt,"sonarr-episode-trimmer>python sonarr-episode-trimmer.py " I get the python error.

Sooo....leads me to believe it's a problem with python or a dependency?

from sonarr.

thezoggy avatar thezoggy commented on July 28, 2024

the error shows that it requested your series and then errored because no json was returned and couldnt process it.

i suspect if you run the script with --list-series you will see your issue..
do you really run sonarr on port 38084 ?

from sonarr.

seanvree avatar seanvree commented on July 28, 2024

@thezoggy

Yes, I am running on http 38084...is that bad?

right, I am running with "--list-series" This is what I get:

C:\sonarr-episode-trimmer>python sonarr-episode-trimmer.py --config C:\sonarr-episode-trimmer\config.ini --list-series
ERROR 303 See Other
ERROR
Traceback (most recent call last):
File "sonarr-episode-trimmer.py", line 131, in
series = api_request('series')
File "sonarr-episode-trimmer.py", line 46, in api_request
return json.loads(resp_body)
File "C:\Python27\lib\json_init_.py", line 339, in loads
return _default_decoder.decode(s)
File "C:\Python27\lib\json\decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Python27\lib\json\decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

from sonarr.

Taloth avatar Taloth commented on July 28, 2024

you're missing the url base for sonarr itself. so the full api url is http(s)://host:port/urlbase/api

from sonarr.

seanvree avatar seanvree commented on July 28, 2024

@Taloth - I actually tried that as well.

Config looks like this:

[Config]
path = E:\TV

[API]
url = http://localhost:38084/sonarr/api (Also tried with no "http://")
key = ce3722936dca4c868d1d183fddb9xxxx

when I add that I get a diff error:

C:\sonarr-episode-trimmer>python sonarr-episode-trimmer.py --config C:\sonarr-episode-trimmer\config.ini --list-series
Traceback (most recent call last):
  File "sonarr-episode-trimmer.py", line 131, in <module>
    series = api_request('series')
  File "sonarr-episode-trimmer.py", line 36, in api_request
    conn = httplib.HTTPConnection(CONFIG.get('API', 'url'))
  File "C:\Python27\lib\httplib.py", line 736, in __init__
    (self.host, self.port) = self._get_hostport(host, port)
  File "C:\Python27\lib\httplib.py", line 777, in _get_hostport
    raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
httplib.InvalidURL: nonnumeric port: '38084/sonarr/api'

C:\sonarr-episode-trimmer>python sonarr-episode-trimmer.py --config C:\sonarr-episode-trimmer\config.ini --list-series
Traceback (most recent call last):
  File "sonarr-episode-trimmer.py", line 131, in <module>
    series = api_request('series')
  File "sonarr-episode-trimmer.py", line 36, in api_request
    conn = httplib.HTTPConnection(CONFIG.get('API', 'url'))
  File "C:\Python27\lib\httplib.py", line 736, in __init__
    (self.host, self.port) = self._get_hostport(host, port)
  File "C:\Python27\lib\httplib.py", line 777, in _get_hostport
    raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
httplib.InvalidURL: nonnumeric port: '38084/sonarr/api'

C:\sonarr-episode-trimmer>

from sonarr.

Taloth avatar Taloth commented on July 28, 2024

I said what the full api url has to be, not what the config should be. To me it seems like the script doesn't support an urlbase, so you'll have to fix that.
https://gitlab.com/spoatacus/sonarr-episode-trimmer/blob/master/sonarr-episode-trimmer.py#L34

from sonarr.

seanvree avatar seanvree commented on July 28, 2024

@Taloth - You're the fucking man!

For anyone else who is having this problem,

Change line 34 in sonarr-episode-trimmer.py to add your URL base (configured in Sonarr Settings -> General)

    url = "/[URLBASE]/api/%s?%s" % (action, urllib.urlencode(params))

Example:

 url = "/sonarr/api/%s?%s" % (action, urllib.urlencode(params))

from sonarr.

Taloth avatar Taloth commented on July 28, 2024

nononono, 'sonarr' is the 'urlbase' you configured in Sonarr Settings->General, it's NOT a constant!

from sonarr.

seanvree avatar seanvree commented on July 28, 2024

@Taloth , Yeah, I got that. It's working.

Ahh, I see, you mean, if for some reason someone else configured their URLbase to something else besides Sonarr?

from sonarr.

Taloth avatar Taloth commented on July 28, 2024

The default is empty. You use an urlbase for reverse proxies and such.

from sonarr.

markus101 avatar markus101 commented on July 28, 2024

Brain dump of what I think this could be:

  • Profile system, linked to series via tags (Delay Profile-like)
  • Retention policy? (Though supporting #2173 would require a different name I think, unless it's something different)
  • Option to select how episodes are deleted:
    • Aired more than X days ago
    • Only keep X episodes
    • If we have watched status we could also tie that into the above options

from sonarr.

thezoggy avatar thezoggy commented on July 28, 2024

the option to keep how many episodes/what to delete for me can widely vary.. so whatever the solution it needs to be per show not just global.. so having it work kinda like tags would be cool.

since certain shows i dont care about season older than current (ex: survivor), certain shows I would only want x amount/certain date (daily shows).

to keep things simple, you could just have an option at the series level for retention.

from sonarr.

mturley avatar mturley commented on July 28, 2024

Sorry if the answer is somewhere up the thread, I only read about half of it ... But I just discovered the sonarr GitHub issues and I'm curious if there is any progress on this or intention to include it?

from sonarr.

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.