Jump to content


Photo

Autotimer - Save discspace script (dummy files)


  • Please log in to reply
No replies to this topic

#1 Weiti

  • Senior Member
  • 53 posts

0
Neutral

Posted 4 January 2014 - 15:33

Hi guys,

I love the autotimer plugin. I use it to record all episodes of several series. It is configured to record only if the episode isn't already on the disk. The problem is: I'm running out of diskspace, because of the need to store old episodes. 

But I cannot delete the episodes, because the autotimer should be activated all the time waiting for the next season to be aired.

 

So I created a very simple python script to "convert" episodes into dummy-files. The are shown in the filelist but cannot be viewed and have a size of 7KB. I tested it with Haven running at SyFy. All Files remaining have a size of less than 100MB.

 

Using this script will create dummy file for ALL episodes! Be sure you watched all before using. 

Maybe there is a way to only delete episodes which are watched using the progress stored in one of the files?

 

Another shortcoming is the usability: I run it from my PC, the hdd of my xtrend is mounted via network-share. The series you want to convert to dummies must be identified via a variable.

 

For testing the last line could be removed, so nothing will be deleted.

 

 

import os

def main():
    pass

if __name__ == '__main__':
    main()
pattern = ' - Syfy HD - Haven'


for filename in os.listdir("."):
    if pattern in filename and filename.endswith('.ts'):
        os.rename(filename, filename+'_tmp')
        f = open(filename, 'w')
        f.write('Dummy\n')
        print (filename)
        f.close()
        os.remove(filename+'_tmp')

 




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users