This project has moved and is read-only. For the latest updates, please go here.

Change in 'Min_Age' Logic Request

Topics: question
Jul 9, 2015 at 8:09 PM
Is it possible to change the logic for the 'min_age' function? Right now, it is set to a number of days since the file existed. I'd like to have files renamed/moved as soon as they are done recording, but I wouldn't want to try and rename/move a file that is still recording.

Can it instead be a number of minutes since the file has been last written to? I would set up a scheduled task to run WTVMetaRenamer every few minutes, and it would move/rename anything that has NOT been written to in the last x minutes. That way the file would be moved/renamed very soon after the recording is done (and Plex can pick it up from there), but a "file-in-use" issue would never result:

Get-Childitem *.wtv | where {$_.Lastwritetime -lt (date).addminutes(-x)}

Secondary benefit, HUGE increase in WAF! :)

Thoughts?

-Quinn
Jul 10, 2015 at 11:05 AM
If your ultimate outcome is to be able to run the script regularly and not have it trip up over files that are still being recorded to, it may be simpler to modify the script to do just that - not trip up over open files.

Does that sound like it would meet your needs? It would be simpler to implement :)
Jul 10, 2015 at 6:24 PM
Yeah, that sounds like it would work well. My environment is this:

I have a VM running Windows 7 and WMC doing all of my recordings off of a network tuner. What I'd like to have happen is have those .wtv files renamed and moved to a share on the host server (where Plex is running) within minutes of being complete, without interfering with any currently-recording files.

If you're change would allow that to happen, then I'd be a happy camper!

-Quinn
Jul 10, 2015 at 6:57 PM
Edited Jul 11, 2015 at 4:04 AM
This is how I have solved the same challenge you are trying to solve.


1) Load the Task Scheduler Scripts
2) Move the files in the ZIP folder to C:\Move folder (create it first) http://www.megafileupload.com/hm8U/Move_Movies.zip
3) Edit the bat file to ensure you move the movies to the right folder that you want
4) Install this program to set up your movies (http://www.missingremote.com/forums/yammm-beta-1310220076).. more info from here: http://mikinho.com/yammm/ ,
5) Then I run an auto task schedule to run the wtvmetarenamer for the rest of the non-movie files and that places them in folders with the right names of the shows 5 minutes after the first task to move the movies files.


Good luck....my has been working for 3 years without any issues.