Any way to move cancelled or finished shows to another partition?

Pho3nix

The Legend
Joined
Jul 31, 2009
Messages
30,589
Hi,

As above, looking for a piece of software or something that can do the above if possible.
Any one have experience with the above?

If all else fails, I'll script something :|
 

CamiKaze

Honorary Master
Joined
May 19, 2010
Messages
14,846
How would you know if it's cancelled or finished without getting the status from the web?
 

AchmatK

Honorary Master
Joined
Dec 8, 2009
Messages
10,049
Sonarr does indicate if a show is no longer running.

Not sure how to get it moved to another partition.
 

Pho3nix

The Legend
Joined
Jul 31, 2009
Messages
30,589
How would you know if it's cancelled or finished without getting the status from the web?

Status xml file in the root folder of a show.
Decided I'll make a small console app to get the job done, that or a powershell script.

Will update thread with code/app if anyone ever needs it.

Just need to get home :|
 
Last edited:

Arthur

Honorary Master
Joined
Aug 7, 2003
Messages
26,879
Sorry, OP. Lapsing into GN mode is irresistible.

/GN on

anyway <> any way

Anyway is an adverbial discourse marker that generally functions to deprecate the prior clause. It often functions like the phrase "be that as it may".

/GN off
 

cpu.

Executive Member
Joined
Jun 23, 2010
Messages
5,423
Sorry, OP. Lapsing into GN mode is irresistible.

/GN on

anyway <> any way

Anyway is an adverbial discourse marker that generally functions to deprecate the prior clause. It often functions like the phrase "be that as it may".

/GN off
If there is any way to make this sink in, your way is not it. Unless simplified, he will do it his way anyway.
 

Pho3nix

The Legend
Joined
Jul 31, 2009
Messages
30,589
For the Nazi's, I've reported thread to request mod to change :p

As for the code, the thinking behind this is correct albeit , Sickbeard and I'm thinking Sonaar would have an issue where in some shows like "Once Upon a Time" are seen as ended while they are in fact still "Continuing", think it's an issue with there being multiple shows with the same name, so you'd have to check the directories listed to make sure they are correct and are actually over.
 

Pho3nix

The Legend
Joined
Jul 31, 2009
Messages
30,589
No code nazi's please. In C#, completed code.
Should be easy enough to change it to python for those on linux etc.
Code:
            List<DirectoryInfo> moveDirectories = new List<DirectoryInfo>();
            DirectoryInfo DirInfo = new DirectoryInfo(@"dir");

            foreach (DirectoryInfo d in DirInfo.GetDirectories())
            {
                if(d.FullName == @"\\dir\System Volume Information")
                {
                    continue;
                }
                var files = from f in d.EnumerateFiles()
                            where f.Extension.Equals(".xml")
                            select f;
                foreach (FileInfo f in files)
                {
                    var doc = XDocument.Load(f.FullName);
                    foreach (var child in doc.Element("Series").Elements())
                    {
                        if(child.Name.LocalName.Equals("Status") && child.Value != "Continuing")
                        {
                            Console.WriteLine(f.Directory);
                            moveDirectories.Add(f.Directory);
                        }
                    }
                    
                }

            }
            foreach(DirectoryInfo oldPath in moveDirectories)
            {
                oldPath.MoveTo("newPath");
            }

Haven't tested it but should work :p
 
Last edited:

Arthur

Honorary Master
Joined
Aug 7, 2003
Messages
26,879
For the Nazi's, I've reported thread to request mod to change :p
Thanks, Pho3nix. It's a relief to be liberated from Grammar Nazi mode. You have no idea how often the Inner GN is provoked. Usually I manage to resist. Glad to see this thread title also liberated. ;)
 
Last edited:
Top