Results 1 to 10 of 10

Thread: Robust Folder Manipulation - folders.tcl

  1. #1
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    427

    Robust Folder Manipulation - folders.tcl

    Here is a script to quickly and easily manipulate folders on any Tivo. Just run the attached script, and follow the prompts. Specifically, the script will:

    1) Add shows to a folder

    2) Create new folders (See here for details).

    3) Remove shows from a folder

    4) Rename a folder

    5) Automatically match shows with folders. More information here.

    6) Duplicate the directory structure from your Tivoserver PC so that shows automatically get put into folders after they transfer to your Tivo. See here for more details.

    7) List all folders and their contents

    8) List orphan shows that aren't in a folder

    9) Change the attributes of all shows in a particular folder, such as the Original Air Date, Actors, Title, or Episode Description.

    10) Reorder shows based on original air date or showing date.

    11) Reorder shows in a folder using season/episode notation. So show.S02E12.mpg appears before show.S03E09.mpg in NPL. See example in next post.

    12) Make show titles "nice". This includes:
    - If the show does not have an episode title, set the episode title equal to the show title, and then change the show title to equal the series title.
    - Strip off file extensions from episode titles.
    - Remove tivo formatting from tivoserver insertions - i.e. strip off braces.
    - Strip off torrent formatting, so "My.Boys.S01E18.DSR.XviD-SYS.mpg" gets changed to "My Boys" Season episode info then gets added to show description.
    See example in next post.

    This script offers the following improvements/differences over previously developed folder tools:

    - Works reliably and quickly.
    - Can group multiple shows at once.
    - Combines multiple folder tools in a single script.
    - Does not require you to look up fsids.
    - Prompts user for input.
    - Changes are implemented immediately, without needing to play the show first.
    - Works independently of TWP.
    - Works on unsubbed tivos.
    - Can be run from cron to AutoMatch shows to folders periodically.

    Usage: Run without arguments, and follow the prompts.

    References:
    1. lgkahn's excellent TWP user interface module
    2. This thread
    3. This thread
    4. angra's code to manipulate wishlist folders here.

    Current version is 2.9

    Please don't ask support questions in this thread. Instead, ask here.
    Attached Files Attached Files
    Last edited by rbautch; 04-21-2010 at 05:34 PM.

  2. #2
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    427
    I've modified the script posted above to add the following features:

    Change the attributes of all shows in a particular folder, such as the Original Air Date, Actors, Title, or Episode Description.

    Reorder shows in a folder using season/episode notation. So show.S02E12.mpg appears before show.S03E09.mpg in NPL.

    Make show titles "nice". This includes:
    - If the show does not have an episode title, set the episode title equal to the show title, and then change the show title to equal the series title.
    - Strip off file extensions from episode titles.
    - Remove tivo formatting from tivoserver insertions - i.e. strip off braces.
    - Strip off torrent formatting, so "My.Boys.S01E18.DSR.XviD-SYS.mpg" gets changed to "My Boys" Season episode info then gets added to show description.

    Here's an example of what features 11 and 12 do:
    Before:


    After:


    Note that the episodes have been ordered according to the season/episode designation, the season/episode information has been moved to the episode description, formatting and extensions have been stripped off, and periods and underscores have been converted to spaces.
    Last edited by rbautch; 04-21-2010 at 05:31 PM.

  3. #3
    Join Date
    May 2004
    Location
    New England
    Posts
    372
    Hi rbautch - nice tcl, thanks!
    is there a way to create a brand new folder to move shows into?
    For instance, can I create one called "Dad's Movies"?
    Two DSR7000s both at 6.4a/101 from slices; both originally sleepered version 3, then 4.01b, 6.2, 6.2a.
    TWP 2.1, Superpatched, 300GB Seagate in one, 750GB in the other, USB 2 w/ Jamie's backport drivers
    One HR10-250 at 6.4a, networked, Superpatched, stock 250GB drive
    One HR23
    Patiently waiting for a new DirecTV/Tivo
    One AM21 hooked to the HR23

  4. #4
    Join Date
    Jun 2006
    Location
    Dougal County
    Posts
    1,014
    The tivo doesn't really like to arbitrarily create new folders. See rbautch's post #13 in this thread.

  5. #5
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    427
    Let's respect this forum's rules, and not post support questions here. I'll link to the support thread in the OP.

  6. #6
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    427
    Using code contributed by angra, I've added the ability to create new folders. I also added a few new options for listing folders and their contents. New script is in the OP.

  7. #7
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    427
    I uploaded a new version to the OP. This one automatically matches up orpan shows to existing folders. I set it up for partial matches on folders, so if a show is called "Star Trek Next Generation" it will automatically get matched up with the "Star Trek" folder. I found this especially useful for tivoserver transfers. If I have a bunch of movies that I want to transfer with tivoserver to a "Movies" folder on the tivo, I can't rename all the files on the PC to the same name, but I can append or prepend -Movies- to the filename so gets matched up with the Movies folder.

    This version can also be run from cron, say once every hour, so transferred shows automatically get sucked up into folders. It can now be run using selction tools as arguments. For example, running:
    Code:
    ./folders.tcl 4c
    will list all folders and shows, and running:
    Code:
    ./folders.tcl 4
    will go directly to submenu for listing shows. So to automatically match shows with cron, use:
    Code:
    ./folders.tcl 7
    or:
    Code:
    ./folders.tcl 8
    A few more notes:
    - AutoMatching ignores shows that are already in folders.
    - Will work on wishlist folders as well as regular folders.
    - Shows can be AutoMatched with folders based on the show title or the episode name. I may also add a third option to match based on some other obscure or infrequently used MFS object so you can tailor XML files for tivoserver transfers.
    - If you'd rather have exact matches instead of partial matches, edit the script to replace all instances of *$folder* with $folder


    Thanks to user Jasch for his idea to add AutoMatching to the script.

  8. #8
    Join Date
    Mar 2005
    Posts
    233
    I have a script I run when I am collecting old shows that are being aired out of order, but I want to watch based on the original air date. It appears to be appropriate for this script, so patched this script accordingly. I also added some code to ignore the "HD Recordings" folder that appears on my THD. Only tested on 11.0 THD.
    Attached Files Attached Files
    Last edited by jkozee; 02-11-2010 at 11:26 PM.

  9. #9
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    427
    Quote Originally Posted by jkozee View Post
    I have a script I run when I am collecting old shows that are being aired out of order, but I want to watch based on the original air date. It appears to be appropriate for this script, so patched this script accordingly. I also added some code to ignore the "HD Recordings" folder that appears on my THD. Only tested on 11.0 THD.
    I get this error when I run your modded script on my 6.2 DTivos:
    Code:
    Searching for Top Gear..wrong # args: should be "string compare string1 string2"
        while executing
    "string compare -length 19 $name "1:ZZZZZHDRECORDINGS""
       <snip>
    I'm guessing that older software versions like 6.2 run a version of the string command that doesn't support the -length option.

    Another issue is that I failed to update the OP with the newer versions of the script that I posted on TCF, so you ended up modifying an obsolete version. Sorry about that. After making some recent enhancements, I rolled up all your changes into version 2.9, which I will post in the OP after I comment out the offending string commands shown above. If you can change the way you look for HD recordings, I'd be happy to test it and incorporate it into the OP. If worst comes to worst, you could also do a software version check.

    edit: I fixed the string compare issue by replacing this command:
    Code:
    if { [string compare -length 19 $name "1:ZZZZZHDRECORDINGS"] != 0 } {
    with this one:
    Code:
    if { ! [string match "1:ZZZZZHDRECORDINGS*" $name ] } {
    It does essentially the same thing, and by using the wildcard it will only match the beginning of the show name. The new version is now attached to the OP.
    Last edited by rbautch; 04-21-2010 at 05:49 PM.

  10. #10
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    427
    I attached version 2.9 to the OP, which has some new features that I find particularly useful, including:

    - Automatching shows with folders

    - Duplicating the folder structure from your PC, so tivoserver/mfs_ftp transfers automatically get organized into corresponding folders after they're transferred.

    - New features by jkozee described above.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •