# Rbautch's Folder Script & Question



## Markman07

I noticed today in the All Tivo and Dtivo Files forum on the DDB site that our friend Rbautch has posted a new / updated folders.tcl script file. This script when run allows you manage your tv programs and the folders they reside in. Check it out

I wasn't sure where to post questions in direct relation to it so I came back here not only to share the news but to ask a question because of my issue running it. 

It sounds so easy! So I download and FTP it to my Enhancements folder. I telnet to the box and am ready to rock. I run the script. It prompts me to enter 1, 2, 3 
------
"Please select from the following:
1 Add show(s) to an existing folder.
2 Change the name of a folder.
3 Remove a show from a folder.
Enter the number corresponding to the action you want to perform:"
-------------

No matter what number I try (1, 2, or 3) and pressing enter. I get an error message saying I need to enter 1, 2, 3! So I shake and slap my head thinking "huh, now what am I doing wrong?" Here I thought I finally was an expert with most whole numbers :-D Any ways.... 

This box is a Series 2 Zippered DTivo. So with the risk of embarrassing myself by asking a possibly dumb question, What am I doing wrong when it comes to entering a number 1, 2 or 3? 

Sincerely,

ME


----------



## beejaycee

I've not used the update script but it might be that your telnet program is entering extraneous information with the carriage return, a common problem I think if you are using the MS Windows telnet. From START/RUN, I use


> telnet -t vt100 192.168.0.xxx


 where xxx is the last 3 digits of my IP address. Hopefully that makes sense. I've had a similar problem in the past and this helped me.


----------



## Markman07

Yes I learned about the telnet issue shortly after learning about the zipper. (long ago now) I actually set up a telnet.ini to always use the "unset crlf" So that doesn't appear to be the problem in my case :-( 

I also tried PuTTY and same result.


----------



## rbautch

Still sounds like terminal settings. Try running this batch file on your PC, and try it again from a regular dos command window. Also make sure you invoke the script with


Code:


tivosh folders.tcl


----------



## Yog-Sothoth

Instead of messing with the Windows utility, why not use something such as PuTTY (it's free)?


----------



## MungoJerrie

Definitely something with your terminal program; works fine with Terra Term Pro. Also, you can just run it like:


Code:


./folders.tcl

From the directory it's in.

Cool script, BTW!


----------



## Markman07

Yog-Sothoth said:


> Instead of messing with the Windows utility, why not use something such as PuTTY (it's free)?


Yog-Sothoth read my last post 2:43PM ..I did try pUtty!

I have used other apps via Telnet on my Dtivos with no issues but I will see what I can figure out in this case.

---------
Update - the batch file corrected whatever was causing my issue. Thanks again Rbautch and everyone else who had suggestions.


----------



## willardcpa

Russ, gave this one a test drive tonight. Works great.


----------



## rbautch

willardcpa said:


> Russ, gave this one a test drive tonight. Works great.


Cool.


----------



## LlamaLarry

I definitely like it and works great on 6.3a. Only things that bug me are either a result of the way TiVos handle grouping/grouped objects.

If I want to move a show from a folder back to the root level do I move it to folder "" (without quotes)?


----------



## rbautch

LlamaLarry said:


> I definitely like it and works great on 6.3a. Only things that bug me are either a result of the way TiVos handle grouping/grouped objects.
> 
> If I want to move a show from a folder back to the root level do I move it to folder "" (without quotes)?


To move a show to root level you atually have to remove it from the folder, using option 3.


----------



## willardcpa

Now that this thread has some "legs" is there a way to start up a "new" folder. I MRV'd some programs to a "server" DTivo that is not hooked up to the sat, some of the shows are pretty old, and they ended up single file, instead of in a folder. Even though they came out of a folder on the source box.
I've got a box with 200+hrs that has signs of HD failure, so I transferred all of the shows over to the "server" before it is too late. But now I've got a now showing list umpteen pages long.


----------



## rbautch

willardcpa said:


> Now that this thread has some "legs" is there a way to start up a "new" folder. I MRV'd some programs to a "server" DTivo that is not hooked up to the sat, some of the shows are pretty old, and they ended up single file, instead of in a folder. Even though they came out of a folder on the source box.
> I've got a box with 200+hrs that has signs of HD failure, so I transferred all of the shows over to the "server" before it is too late. But now I've got a now showing list umpteen pages long.


Tivo doesn't like the creation of folders from scratch, but there's a way around it. Tune your tivo to an episodic show that you would never usually watch - like The View. Record a few seconds of it, then stop recording. Then start recording it again, then stop - this should create a folder called "The View". Then use folders.tcl to change the name of the folder and add your shows.


----------



## cr33p

So let me make sure I understand what this new utility does. 

I can move shows around that are on my tivo in to different folders. IE. when I use tivoserver to transfer shows from my pc to my tivo they will not go in to a folder they show up all seperately, I can use this utility to organize them in to a folder? 

Thanks


----------



## thepackfan

Yep, it works great for organizing kids shows


----------



## dishdudes

OK I FTP'ed it up telneted in and get this..

livroom-bash# sh folders.tcl
folders.tcl: EnableTransactionHoldoff: command not found
folders.tcl: puts: command not found
folders.tcl: puts: command not found
folders.tcl: puts: command not found
folders.tcl: puts: command not found
folders.tcl: puts: command not found
folders.tcl: flush: command not found
'olders.tcl: line 40: syntax error near unexpected token `
'olders.tcl: line 40: ` }
livroom-bash#

Any ideas? Tried 2 diff Tivos, so I missing something here.. 

Thanks.


----------



## MungoJerrie

Yup, you might want to read posts 4 & 6 which provide the syntax for properly running the script in tivoshell (tivosh - not sh)!


----------



## Chopper Dad

dishdudes said:


> OK I FTP'ed it up telneted in and get this..
> 
> livroom-bash# sh folders.tcl
> folders.tcl: EnableTransactionHoldoff: command not found
> folders.tcl: puts: command not found
> folders.tcl: puts: command not found
> folders.tcl: puts: command not found
> folders.tcl: puts: command not found
> folders.tcl: puts: command not found
> folders.tcl: flush: command not found
> 'olders.tcl: line 40: syntax error near unexpected token `
> 'olders.tcl: line 40: ` }
> livroom-bash#
> 
> Any ideas? Tried 2 diff Tivos, so I missing something here..
> 
> Thanks.


 I'm a relative newbie to all this, but reading the thread made this pretty straightforward, and it works quite well. I'm delighted! I did have to make sure the tivo partition was writeable by telneting into it (I use PuTTy) and - using the "shortcut" Russ provided in his enhancement script - doing an 'rw' at the bash prompt. Without that, I couldn't successfully ftp the 'folders.tcl' file into the '/enhancements' directory. Once those 2 things were done - running Russ' 'rw' shortcut for 'writeability' and ftping the file over, it was simple to 'cd /enhancements' and run the app. (per posts 4 & 6: either 'tivosh folders.tcl' or './folders.tcl'.

I know it's been said many times before, Russ, but thank you so very much for all your hard work and generosity in doing what you do. Not only have your contributions provided me a fairly straightforward way to hack my Dtivos so as to radically improve their functionality, but they've re-stimulated an almost dormant interest in Linux, and I'm having a truly delightful time!

And to all you others who've contributed so much - far too many to list - a big round of applause to you as well!

CD


----------



## rbautch

You're welcome!


----------



## Da Goon

Best tivo utility since tivoserver.
Finally, tivoserver can be organized.


----------



## LlamaLarry

This is definitely very very useful. BTW, what does the folders module in TWP do? I was never able to make it do anything; I really expected it to do what your script does. 

Collecting all the kids shows, and on my bedroom TiVo the grownup shows  , into a single folder has really made the NPL easier to browse through. Thanks a bunch!


----------



## Markman07

Here is a good one. 

I renamed a folder and put all my kid's shows into it. Tested in on the Dtivo and worked great. 

So last night I am browsing through the NPL on my Dtivo and notice the folder I renamed and put 20+ shows in is missing. Troubleshooting the issue I notice that the shows are indeed on my Dtivo and playable but now only if I turn off Folders / Groups on the Dtivo. If I use groups or folders this folder is no where to be found or the shows in them. Any ideas on my weekend dilemma? 

Sincerely,

I screw things up so others don't have to! :-D


----------



## LlamaLarry

Is the folder you renamed back? Does either name appear on the scan the utility displays?


----------



## rbautch

Markman07 said:


> Here is a good one.
> 
> I renamed a folder and put all my kid's shows into it. Tested in on the Dtivo and worked great.
> 
> So last night I am browsing through the NPL on my Dtivo and notice the folder I renamed and put 20+ shows in is missing. Troubleshooting the issue I notice that the shows are indeed on my Dtivo and playable but now only if I turn off Folders / Groups on the Dtivo. If I use groups or folders this folder is no where to be found or the shows in them. Any ideas on my weekend dilemma?
> 
> Sincerely,
> 
> I screw things up so others don't have to! :-D


See if it reverted back to the original folder name.


----------



## rbautch

LlamaLarry said:


> This is definitely very very useful. BTW, what does the folders module in TWP do? I was never able to make it do anything; I really expected it to do what your script does.
> 
> Collecting all the kids shows, and on my bedroom TiVo the grownup shows  , into a single folder has really made the NPL easier to browse through. Thanks a bunch!


lgkahn wrote the ui module for TWP that does grouping, and he's really the pioneer of folder manipulation. It is supposed to do the same thing, group shows. I've had mixed luck with it, and did not find it intuitive.


----------



## Xtra7973

Just when I was getting use to going to the now showing list in TWP, then clicking on a show and using the edit program action at the bottom rbautch had to go and make it all easy for us. 

I must say though I still like the ability that im able to edit the episode description and all the other stuff using the old way but this sure makes it much much easier to simply move shows around. I really cant thank you enough for all your work rbautch.


----------



## marct

So this only moves 1 show at a time, unless the string matches multiple shows? I wish I could name multiple different shows, for example movies, to move them to a movies folder. 

Edit: just wondering why sometimes it says it moves 2 shows with the same name when there is only 1 show with that name?

BTW: This is awesome! Thanks a bunch.

marc.


----------



## rbautch

marct said:


> So this only moves 1 show at a time, unless the string matches multiple shows? I wish I could name multiple different shows, for example movies, to move them to a movies folder.
> 
> Edit: just wondering why sometimes it says it moves 2 shows with the same name when there is only 1 show with that name?
> 
> BTW: This is awesome! Thanks a bunch.
> 
> marc.


Yep, they all have to match. Note that you only have to enter part of the name, or even a few letters, to get a match. In the future, I may add an option to search by episode title in addition to show title. It this still doesnt help, you can use TWP to rename all the shows - or maybe append a common set of characters to the beginning or end of them to force a match.

Which option are you getting the incorrect count on? Add to folder or remove from folder?


----------



## marct

rbautch said:


> Which option are you getting the incorrect count on? Add to folder or remove from folder?


Add show to an existing folder. Here is a sample result. 


> Enter the name (or part thereof) of the show(s) you want to add to this folder: Last Days
> Found a matching show called "Last Days". Moving to "Movies" folder...
> Found a matching show called "Last Days". Moving to "Movies" folder...
> SUMMARY: Added total of 2 shows to the "Movies" folder.
> Done!


Note: There was only 1 show, and only 1 copy ends up in the folder.

FYI: i am running 6.2 on a DirecTivo.


----------



## Xtra7973

marct I had the same thing happen to me twice. Once when I moved 1 show with the same result as yours and another time when I moved 5 shows and it said it moved 10. But the end result was it worked. So sometimes the summary doubles it I guess? Any ideas rbautch?


----------



## LlamaLarry

Doesn't it only happen when you move a program into a folder that has yet to be examined? So it finds the program in root (for example) then finds it again in the folder if the folder name is alphabetically lower than the program name?


----------



## Xtra7973

LlamaLarry. Thats a good question, but im going to have to say no. I had 5 shows I MRV'd from one box to the other. Now for some reason the 5 shows I moved didn't show up in a folder on the receiving box. So when I made a folder for those 5 shows and moved them into the folder thats when it showed up as 10 moved instead of 5.


----------



## rbautch

I changed the location in the loop where the show gets counted, which may prevent it from getting couted twice. Try the attached debug version, which which lists the FSID of every show found, so if it's still double counting, it will be obvious.

edit: attachment removed - see below.


----------



## marct

I will give that a try tonight.


----------



## LlamaLarry

I can say that it does not appear to be what I thought, reacquiring a program in the move destination, but I can't duplicate the error with either version of the script now. 

I did have another folder revert to the original name, but was still alpha sorted on the NPL using the new name. Really messed with Thing 2's head, he thought the list was looping.


----------



## marct

ok, I used your debug version, and first try it did it again. Same feedback as above with the addition of the FSID info. Both lines said "with FSID of 390045..."

EDIT: And my movies folder has reverted to the original show name too. I'll give it a change a little later again.


----------



## rbautch

I was able to replicate the double counting phenomenon. Seems that if a show is non-episodic it gets counted once, and then gets counted again after the series object is assigned to it. I was able to fix it in the attached version 1.1 of the script, and it seems to be counting correctly now.

Regarding folder name changes not sticking, I believe the issue stems from a relationship between series ID and program name embedded in guide data. So when you get new data, the title wants to revert back. As a temporary fix, version 1.1 will take arguments for foldername changes OR run interactively, allowing you to run it periodically from cron in order make folder name changes stick. The crontab entry might look like this:


Code:


20 9 * * * tivosh /folders.tcl "The Jeffersons" "Kids Movies"

This would rename the folder every night at 3:20am. You can avoid doing this if you can find a series that's only on once in awhile, like the World Series. I'll see if I can find a more permanent fix.

edit: attachment removed. See below...


----------



## marct

You know your stuff! Glad to see the double count was easily fixable. I love your fix for folder name changing!  Brute Force!!!


----------



## Markman07

rbautch said:


> See if it reverted back to the original folder name.


Yes I found the shows were in the old folder name. I was putting my kids shows into a Kids folder. I did this by...

1. I first renamed "Curious George" folder to "Kids Shows'
2. I then copied a bunch of shows to my new Kids Shows folder (Blue's Clues, 2 MRV (TIVOSERVER shows), etc).
3. Tested and Folder was working great...a few days pass by.
4. Season Pass for Curious George records a few new shows....

I am presuming each folder has an ID and when I renamed it the ID # stays the same. I am then guessing when my season pass for Curious George recorded a few shows that the Tivo in turn renamed my custom named folder back to the original. Am I wrong with my assumption?


----------



## rbautch

It the guide data that's causing shows to revert back to the original name. I'm modifying the script as we speak to automatically set up cron job to make the name change permanent. This of course will require you to have cron installed.


----------



## marct

Is it really that hard to create a folder from scratch? Is there some reference you can point to, I might be having a fit enough to dig in with you and work on fixing that.


----------



## rbautch

marct said:


> Is it really that hard to create a folder from scratch? Is there some reference you can point to, I might be having a fit enough to dig in with you and work on fixing that.


Yes it is, and it could fubar your tivo. Read the threads I referenced on DDB. Chrised has some success in creating new series objects, but only when he parsed the full XML data that was associated with a show during an mfs_ftp extraction/insertion.


----------



## marct

I was even wondering if you could add a bogus item to the guide, and then the guide would never see a show from that series again, so maybe the new guide data would not update it. 

I'll take a peek, I have no doubt you know your way around thoroughly, was just asking.


----------



## rbautch

marct said:


> I was even wondering if you could add a bogus item to the guide, and then the guide would never see a show from that series again, so maybe the new guide data would not update it.
> 
> I'll take a peek, I have no doubt you know your way around thoroughly, was just asking.


That would be an interesting avenue to explore. I briefly looked at the way guide data is stored in MFS last night. Show titles appear to be stored in mfs/GuideIndexV3/Title, which looks like a plain text file. Before starting down the path of modifying this file, I theorized that it might get overwritten every time new guide data comes down from the mothership. Maybe not, though. Let me know what you discover.


----------



## rbautch

Here is version 1.2 of the folders script. To make folder renaming stick, this one will detect if you have a cron installation, and will automatically generate a crontab entry to rename the folder every night. I know it's a little kludgey, but it works.  This version also has a few extra options added to the menu for listing folders and shows. I found this to be helpful for working on folders without having to look at the Now Playing List.

edit: attachment removed - see current version below


----------



## Markman07

Thanks Rbautch! Will test out the latest version.


----------



## marct

So I spent a bit of time looking about last night too. i think I need another 6 or so hours before I have a good enough understanding to be where you are. I read all about the problem with creating series IDs (FSID) without creating a series and the issues there. 

At this point I want to strangle some of the initial developers of the Tivo software, what a mess.


----------



## PowerfulOne

This is really picky, I know, but the error message that displays if you don't enter the correct number still says "enter 1,2, or 3" instead of allowing 1 thru 5.

I do like the two additional options, to displays the folders and shows. When I first tried this I was kind of at a loss to know what to do, not knowing exactly what the folders or shows were called.


----------



## PowerfulOne

I tried version 1.2 on a group of shows. Some of them (but not all) double-counted.

It is interesting that the folder had 8 shows in it to start with, and I added 14, for a total (after the move) of 22, which is what the script said it moved.

I also noticed that the date/time stamps of the added shows were not in the same order and the episode numbers, so they did not appear in the folder display in the right episode order. I should have modified the date/times before I moved them to the Tivo (with TivoServer). Might this have anything to do with the counting error? Do you know of a way to edit the date/time of the episode information on the Tivo?



Code:


Tivo3-bash# ./folders.tcl
Please select from the following:
1   Add show(s) to an existing folder.
2   Change the name of a folder.
3   Remove a show from a folder.
4   List all folders and folder IDs.
5   List all shows and recording IDs.
Enter the number corresponding to the action you want to perform: 1

Enter the name of the TARGET FOLDER you want to add shows to: Hex
Searching for Hex...............................................................
...........................................................
Found a folder named "Hex" containing 8 episodes.
Enter the name (or part thereof) of the show(s) you want to add to this folder:
Hex-
Found a matching show called "Hex-105-The Release".  Moving to "Hex" folder...
Found a matching show called "Hex-201-Cursed".  Moving to "Hex" folder...
Found a matching show called "Hex-202-Death Takes The Mother".  Moving to "Hex"
folder...
Found a matching show called "Hex-203-Spiral".  Moving to "Hex" folder...
Found a matching show called "Hex-204-Ella Burns".  Moving to "Hex" folder...
Found a matching show called "Hex-205-With A Little Help From My Friends - 1".
Moving to "Hex" folder...
Found a matching show called "Hex-206-With A Little Help From My Friends - 2".
Moving to "Hex" folder...
Found a matching show called "Hex-207-Noir".  Moving to "Hex" folder...
Found a matching show called "Hex-208-Where The Heart Is".  Moving to "Hex" fold
er...
Found a matching show called "Hex-209-Doomed".  Moving to "Hex" folder...
Found a matching show called "Hex-210-You Lose".  Moving to "Hex" folder...
Found a matching show called "Hex-211-Hole".  Moving to "Hex" folder...
Found a matching show called "Hex-212-Seven Deadly Sins".  Moving to "Hex" folde
r...
Found a matching show called "Hex-213-The Showdown".  Moving to "Hex" folder...
Found a matching show called "Hex-105-The Release".  Moving to "Hex" folder...
Found a matching show called "Hex-203-Spiral".  Moving to "Hex" folder...
Found a matching show called "Hex-204-Ella Burns".  Moving to "Hex" folder...
Found a matching show called "Hex-207-Noir".  Moving to "Hex" folder...
Found a matching show called "Hex-201-Cursed".  Moving to "Hex" folder...
Found a matching show called "Hex-202-Death Takes The Mother".  Moving to "Hex"
folder...
Found a matching show called "Hex-206-With A Little Help From My Friends - 2".
Moving to "Hex" folder...
Found a matching show called "Hex-205-With A Little Help From My Friends - 1".
Moving to "Hex" folder...
SUMMARY: Added total of 22 shows to the "Hex" folder.
Done!


----------



## rbautch

Thanks for the observations. I'll check it out.


----------



## InspectorGadget

Does this folder stuff only work on a Series 2 machine, or is there a hack that will enable folders on a SA or DTiVo Series 1?


----------



## rbautch

Nope. Only works on Series 2.


----------



## rbautch

PowerfulOne said:


> I tried version 1.2 on a group of shows. Some of them (but not all) double-counted.
> 
> It is interesting that the folder had 8 shows in it to start with, and I added 14, for a total (after the move) of 22, which is what the script said it moved.
> 
> I also noticed that the date/time stamps of the added shows were not in the same order and the episode numbers, so they did not appear in the folder display in the right episode order. I should have modified the date/times before I moved them to the Tivo (with TivoServer). Might this have anything to do with the counting error? Do you know of a way to edit the date/time of the episode information on the Tivo?


I discovered that the way I eliminated double counting before may not work correctly in all circumstances. This one (ver 3.3) should work better. See if you can test it on the same shows you had problems with before.


----------



## PowerfulOne

rbautch said:


> I discovered that the way I eliminated double counting before may not work correctly in all circumstances. This one (ver 3.3) should work better. See if you can test it on the same shows you had problems with before.


OK, this version seems to work OK.

Before I saw this reply, I deleted all 14 added shows from the Tivo, changed the date/time stamps of each on the PC to be sequential (and not intermixed with the date/times of the 8 pre-existing files in the folder on the Tivo) and re-transferred them with TivoServer. This time when I moved them to the folder with your script (version 1.2) there were only 5 that double-counted instead of 8 yesterday.

When I saw this post, I removed the 14 files from the folder (using option 3) and re-added them (with the new script version 1.3) and only 14 entries were shown, which was correct. So it looks like you fixed the problem that I encountered.

Thanx.


----------



## rbautch

PowerfulOne said:


> OK, this version seems to work OK.
> 
> Before I saw this reply, I deleted all 14 added shows from the Tivo, changed the date/time stamps of each on the PC to be sequential (and not intermixed with the date/times of the 8 pre-existing files in the folder on the Tivo) and re-transferred them with TivoServer. This time when I moved them to the folder with your script (version 1.2) there were only 5 that double-counted instead of 8 yesterday.
> 
> When I saw this post, I removed the 14 files from the folder (using option 3) and re-added them (with the new script version 1.3) and only 14 entries were shown, which was correct. So it looks like you fixed the problem that I encountered.
> 
> Thanx.


Great. I've heard from more than a few users about adjusting the dates on shows in the folder. What would be the desired functionality? Should new shows added always come sequentially after the shows that are already in there?


----------



## PowerfulOne

rbautch said:


> Great. I've heard from more than a few users about adjusting the dates on shows in the folder. What would be the desired functionality? Should new shows added always come sequentially after the shows that are already in there?


Are you suggesting that your script should adjust date/time as the files are added to the folder? I don't think I could generalize on one desirable behavior in this regard. And when transferring multiple shows (by typing only part of the show name) how do I know in what order your script will process the shows?

If dealing with MRVed shows from another Tivo, their date/time would be the date they were actually recorded (I assume) and hence should be retained. If dealing with files transferred from a PC (with TivoServer, like I did) they don't have an actual recorded date/time and the Tivo uses the PC's file date/time value as the recording time. In my case, these turned out to not be sequential with the order the files were broadcast, which I didn't think about at first. I ended up changing the PC date/time to make them sequential and later than the 8 files originally in the folder, but this would not necessarily be the desired order every time.

I think what's needed is the ability to manually edit the recorded date/time for each show so it appears in the folder in a reasonable order. TivoWebPlus has the ability to edit much of the data about each show, but (so far as I can tell) not the recorded date/time. Is there any other existing tool that does that?


----------



## hoss713

I'm getting an error when trying to add "certain" shows:

...
...
...
Enter the name of the TARGET FOLDER you want to add shows to: The Backyardigans
Searching for The Backyardigans................................................................................................................................
Found a folder named "The Backyardigans" containing 4 episodes.
Enter the name (or part thereof) of the show(s) you want to add to this folder: Backyardigans
Found a matching show called "The Backyardigans - Samurai Pie". Moving to "The Backyardigans" folder...
no such object: 
while executing
"dbobj $actualprogram set EpisodeTitle $episodetitle"
("uplevel" body line 41)
invoked from within
"uplevel $body"
invoked from within
"transaction {uplevel $body}"
(procedure "RetryTransaction" line 5)
invoked from within
"RetryTransaction {
set rec [db $db openidconstruction $id]
set showing [dbobj $rec get Showing]
set actualshowing [lindex [dbobj $rec g..."
("uplevel" body line 2)
invoked from within
"uplevel $body"
invoked from within
"ForeachMfsFile id name type /Recording/NowShowingByBucketTitle "" {
RetryTransaction {
set rec [db $db openidconstruction $id]
set showin..."
(file ".//folders.tcl" line 83)

lj


----------



## rbautch

hoss713 said:


> I'm getting an error when trying to add "certain" shows:
> 
> ...
> ...
> ...
> Enter the name of the TARGET FOLDER you want to add shows to: The Backyardigans
> Searching for The Backyardigans................................................................................................................................
> Found a folder named "The Backyardigans" containing 4 episodes.
> Enter the name (or part thereof) of the show(s) you want to add to this folder: Backyardigans
> Found a matching show called "The Backyardigans - Samurai Pie". Moving to "The Backyardigans" folder...
> no such object:
> while executing
> "dbobj $actualprogram set EpisodeTitle $episodetitle"
> ("uplevel" body line 41)
> invoked from within
> "uplevel $body"
> invoked from within
> "transaction {uplevel $body}"
> (procedure "RetryTransaction" line 5)
> invoked from within
> "RetryTransaction {
> set rec [db $db openidconstruction $id]
> set showing [dbobj $rec get Showing]
> set actualshowing [lindex [dbobj $rec g..."
> ("uplevel" body line 2)
> invoked from within
> "uplevel $body"
> invoked from within
> "ForeachMfsFile id name type /Recording/NowShowingByBucketTitle "" {
> RetryTransaction {
> set rec [db $db openidconstruction $id]
> set showin..."
> (file ".//folders.tcl" line 83)
> 
> lj


I couldn't duplicate your error, but this version should suppress the error you got. Did this happen for any other shows?


----------



## hoss713

Yes, it happens for any show that originally existed on an S1... 

I read the folders.tcl code and I figured out the problem. Turns out my files were missing the information needed by folders.tcl - I've solved that problem and now all is well...

lj


----------



## rbautch

PowerfulOne said:


> Are you suggesting that your script should adjust date/time as the files are added to the folder? I don't think I could generalize on one desirable behavior in this regard. And when transferring multiple shows (by typing only part of the show name) how do I know in what order your script will process the shows?
> 
> If dealing with MRVed shows from another Tivo, their date/time would be the date they were actually recorded (I assume) and hence should be retained. If dealing with files transferred from a PC (with TivoServer, like I did) they don't have an actual recorded date/time and the Tivo uses the PC's file date/time value as the recording time. In my case, these turned out to not be sequential with the order the files were broadcast, which I didn't think about at first. I ended up changing the PC date/time to make them sequential and later than the 8 files originally in the folder, but this would not necessarily be the desired order every time.
> 
> I think what's needed is the ability to manually edit the recorded date/time for each show so it appears in the folder in a reasonable order. TivoWebPlus has the ability to edit much of the data about each show, but (so far as I can tell) not the recorded date/time. Is there any other existing tool that does that?


The folders script processes the shows in the order they appear in the MFS database, which is alphabetically. However, the recording date of the show is unchanged. The recording date field is easy enough to edit with a script. The hard part would be getting input from the user so that shows get ordered as desired. The recording date is stored in MFS as a positive integer equal to the number of days since 1969. So today is 13477. Seems better suited to a TWP module, but I may give it shot when I get a chance.

edit: Looks like there's already a script to adjust a show's date. Look for EditTitle.tcl on DDB.


----------



## captainjrl

When experimenting with this script, I accidentally had it remove all episodes from all of the folders. Any idea how to undo this? 

Thanks


----------



## rbautch

Unfortunately, there's no way to undo it until more folders are created by regular recordings. Until this happens, you could create a few dummy folders, rename them, and start putting shows in there. 

Did you accidentally hit return before typing the full name of the show you wanted to remove?


----------



## captainjrl

1- Folders from just regular recordings or will recordings from Season Passes regenerate them. Season Passes have yet to do so and its been 3 days since I did it.

2- In regards to the name thing, sort of. I hit return with nothing typed.


----------



## rbautch

captainjrl said:


> 1- Folders from just regular recordings or will recordings from Season Passes regenerate them. Season Passes have yet to do so and its been 3 days since I did it.
> 
> 2- In regards to the name thing, sort of. I hit return with nothing typed.


Season passes will recreate the folders, but you'll have to manually add the existing shows to them. I'll add a check to make sure blank input gets rejected when removing shows from folders.


----------



## captainjrl

Thanks. The folders are appearing like you stated.

I like the idea of a blank entry resulting in no action. At least my stupidity will result in something good.

Thanks for the great tool!


----------



## tbeckner

rbautch said:


> I'll add a check to make sure blank input gets rejected when removing shows from folders.


Great idea, it happened to me this morning! (a buffered keystroke I am assuming).

How about either aborting or reprompting.

This single second of misfortune caused over an hour of work to rebuild.


----------



## David Platt

I found a problem that I don't think has been reported yet in this thread. 

Several weeks ago, I had a folder with 2 Cosby Show episodes in it. I renamed that folder to 'Trading Spouses' because I wanted to place several episodes of Trading Spouses into it. I then added the TS episodes to the folder, then deleted the Cosby Show episodes from it so they show up 'ungrouped' in my NP list.

The other day, I went to search in upcoming shows for Trading Spouses because I missed an episode and needed to see if it was repeating. Every episode of The Cosby Show in the guide data was now showing as Trading Spouses-- i.e., the show title next to the ouija board said Trading Spouses, but when I went in to the episode information, it was clearly info for Cosby.

Anybody seen anything similar?


----------



## rbautch

David Platt said:


> I found a problem that I don't think has been reported yet in this thread.
> 
> Several weeks ago, I had a folder with 2 Cosby Show episodes in it. I renamed that folder to 'Trading Spouses' because I wanted to place several episodes of Trading Spouses into it. I then added the TS episodes to the folder, then deleted the Cosby Show episodes from it so they show up 'ungrouped' in my NP list.
> 
> The other day, I went to search in upcoming shows for Trading Spouses because I missed an episode and needed to see if it was repeating. Every episode of The Cosby Show in the guide data was now showing as Trading Spouses-- i.e., the show title next to the ouija board said Trading Spouses, but when I went in to the episode information, it was clearly info for Cosby.
> 
> Anybody seen anything similar?


If I understand your issue correctly, this might indeed be expected behavior. Changing a folder name changes the series object for all shows associated with that series, including future shows. The intention was to hijack a folder for a show that you'll never watch, so most folks probably wont readily observe this behavior. I'm not sure if it can be fixed, but I'll check into it.


----------



## David Platt

rbautch said:


> If I understand your issue correctly, this might indeed be expected behavior. Changing a folder name changes the series object for all shows associated with that series, including future shows. The intention was to hijack a folder for a show that you'll never watch, so most folks probably wont readily observe this behavior. I'm not sure if it can be fixed, but I'll check into it.


Ah, okay. Gotcha.

Given that I can't imagine I'd ever watch Cosby very much (just recorded the finale because I wanted to watch it for nostalgia's sake), I can't imagine this will cause much a of a problem.

Good to know for future reference, though-- I'll make sure to create a 'dummy' folder by recording something I know I'll never watch, then change that folder name.


----------



## ruexp67

Here is a new one too...

I renamed a folder, but mistyped what I wanted the result to be. So I renamed it again, this time I mistyped it again and hit a backspace. This gave me a ^H which I ended up saving with the folder name. I renamed it one more time and did not include the ^H and it hung the Tivo. I renamed it a final time by including the ^H and set it to what I wanted it to be.

I then went to add a show to this folder but I get the following:



> Please select from the following:
> 1 Add show(s) to an existing folder.
> 2 Change the name of a folder.
> 3 Remove a show from a folder.
> 4 List all folders and folder IDs.
> 5 List all shows and recording IDs.
> Enter the number corresponding to the action you want to perform: 1
> 
> Enter the name of the TARGET FOLDER you want to add shows to: Save for Later
> Searching for Save for Later....................................................
> ................................................................................
> ..................
> Did not find any folders any shows matching the name "Save for Later".


BTW --



> ID Folder
> ----- -------------------------
> 4999147 2006 World Series of Poker
> 4991971 Chop Cut Rebuild
> 5011537 Classic Rides
> 5012634 Extreme Engineering
> 5008428 MotorWeek
> 5019810 The Ren & Stimpy Show
> *2423737 Save For Later*
> 5008192 The Simpsons
> 5008199 South Park
> 5011537 Classic Rides
> 5017865 MotorWeek
> 5008196 The Simpsons


In general, this is not that big of a deal for me, just kind of weird.

The real issue for me is my bad, bad typing skills. I, for one, would appreciate an "Are you sure" check on title inputs. So on a rename I could enter the new name and the script could ask me if what I just typed is what I want it to be, if no, it would loop back and allow me to retype the title.

All in all, very cool script.


----------



## jstoddard

Rbautch - another great script!

I'm having a bit of trouble moving shows into a recently renamed folder. I was able to create a new folder by renaming a dummy folder that I just created. All went well and I now have a new folder "TV Calibration"

I'm trying to put some HD test pattern videos that I successfully uploaded via mfs_ftp and have watched on the HR10-250. When I go to move them to my new folder, I get the following:

[EDIT - I was successful in moving a show that was actually recorded on the HR10-250, but am not successful in moving shows that were uploaded from my PC. Originally they were TS files that were converted to MPG using HDTVtoMPEG2 and then to TY using ffmpeg and inserted via MFS_FTP]



> TIVO-bash# tivosh folders.tcl
> Please select from the following:
> 1 Add show(s) to an existing folder.
> 2 Change the name of a folder.
> 3 Remove a show from a folder.
> 4 List all folders and folder IDs.
> 5 List all shows and recording IDs.
> Enter the number corresponding to the action you want to perform: 1
> 
> Enter the name of the TARGET FOLDER you want to add shows to: TV Calibration
> Searching for TV Calibration....................................................
> ......................................
> Found a folder named "TV Calibration" containing 2 episodes.
> Enter the name (or part thereof) of the show(s) you want to add to this folder:
> irebars.ty
> Found a matching show called "irebars.ty". Moving to "TV Calibration" folder...
> no such object:
> while executing
> "dbobj $actualprogram set IsEpisode 1"
> invoked from within
> "if { [string match *$showname* $title] } {
> 
> if { $episodetitle != "" } {
> 
> append titlea " -"
> 
> append episodetitlea "\"."
> 
> }..."
> ("uplevel" body line 27)
> invoked from within
> "uplevel $body"
> invoked from within
> "transaction {uplevel $body}"
> (procedure "RetryTransaction" line 5)
> invoked from within
> "RetryTransaction {
> 
> set rec [db $db openidconstruction $id]
> 
> set showing [dbobj $rec get Showing]
> 
> set actualshowing [lindex [dbobj $re..."
> ("uplevel" body line 3)
> invoked from within
> "uplevel $body"
> invoked from within
> "ForeachMfsFile id name type /Recording/NowShowingByBucketTitle "" {
> 
> RetryTransaction {
> 
> set rec [db $db openidconstruction $id]
> 
> set sho..."
> invoked from within
> "if {$selection == 1} {
> 
> puts ""
> 
> puts -nonewline stdout "Enter the name of the TARGET FOLDER you want to add sh
> ows to: "
> 
> flush stdout
> 
> set ta..."
> (file "folders.tcl" line 85)
> TIVO-bash#


Any thoughts? Thanks for all you've provided to this great community!

Jeff


----------



## rbautch

jstoddard said:


> Rbautch - another great script!
> 
> I'm having a bit of trouble moving shows into a recently renamed folder. I was able to create a new folder by renaming a dummy folder that I just created. All went well and I now have a new folder "TV Calibration"
> 
> I'm trying to put some HD test pattern videos that I successfully uploaded via mfs_ftp and have watched on the HR10-250. When I go to move them to my new folder, I get the following:
> 
> [EDIT - I was successful in moving a show that was actually recorded on the HR10-250, but am not successful in moving shows that were uploaded from my PC. Originally they were TS files that were converted to MPG using HDTVtoMPEG2 and then to TY using ffmpeg and inserted via MFS_FTP]
> 
> Any thoughts? Thanks for all you've provided to this great community!
> 
> Jeff


Not sure why this object doesn't exist for that show, but I suppressed the error in the attached version, which should allow the script to finish. If you don't mind, post a screen capture of this object, which you can get from the mfs module in tivowebplus. In TWP, go to MFS, then click on Recording, then NowShowingByBucketTitle. Find your show and click on it, then select ActualShowing.

Since it re-encodes at lower resolution, doesn't using HDTV2MPEG2 defeat the purpose of a High Definition test pattern?


----------



## Mr_Bester

rbautch said:


> Not sure why this object doesn't exist for that show, but I suppressed the error in the attached version, which should allow the script to finish. If you don't mind, post a screen capture of this object, which you can get from the mfs module in tivowebplus. In TWP, go to MFS, then click on Recording, then NowShowingByBucketTitle. Find your show and click on it, then select ActualShowing.
> 
> Since it re-encodes at lower resolution, doesn't using HDTV2MPEG2 defeat the purpose of a High Definition test pattern?


I ended up converting using tyffmpeg while not reencoding. He may want to try that...


----------



## jstoddard

rbautch said:


> Not sure why this object doesn't exist for that show, but I suppressed the error in the attached version, which should allow the script to finish. If you don't mind, post a screen capture of this object, which you can get from the mfs module in tivowebplus. In TWP, go to MFS, then click on Recording, then NowShowingByBucketTitle. Find your show and click on it, then select ActualShowing.


Thanks for the updated script and for your help. I'm getting a little further in the script, but getting another error now on line 89.



Code:


TIVO-bash# tivosh folders.tcl
Please select from the following:
1   Add show(s) to an existing folder.
2   Change the name of a folder.
3   Remove a show from a folder.
4   List all folders and folder IDs.
5   List all shows and recording IDs.
Enter the number corresponding to the action you want to perform: 1

Enter the name of the TARGET FOLDER you want to add shows to: TV Calibration
Searching for TV Calibration....................................................
.................................
Found a folder named "TV Calibration" containing 3 episodes.
Enter the name (or part thereof) of the show(s) you want to add to this folder:
Color Bars
Found a matching show called "Color Bars 601".  Moving to "TV Calibration" folde
r...
no such object:
    while executing
"dbobj $actualprogram set Series $series_target"
    invoked from within
"if { [string match *$showname* $title] } {

                if { $episodetitle != "" } {

                                append titlea " -"

                                append episodetitlea "\"."

                        }..."
    ("uplevel" body line 27)
    invoked from within
"uplevel $body"
    invoked from within
"transaction {uplevel $body}"
    (procedure "RetryTransaction" line 5)
    invoked from within
"RetryTransaction {

                set rec [db $db openidconstruction $id]

                set showing [dbobj $rec get Showing]

                set actualshowing [lindex [dbobj $re..."
    ("uplevel" body line 3)
    invoked from within
"uplevel $body"
    invoked from within
"ForeachMfsFile id name type /Recording/NowShowingByBucketTitle "" {

        RetryTransaction {

                set rec [db $db openidconstruction $id]

                set sho..."
    invoked from within
"if {$selection == 1} {

  puts ""

  puts -nonewline stdout "Enter the name of the TARGET FOLDER you want to add sh
ows to: "

  flush stdout

  set ta..."
    (file "folders.tcl" line 89)
TIVO-bash#

Below I've copied the details of this object within TWP (I'm still using 1.2.1 if that matters). I also did not see an ActualShowing link within the show (maybe this is the problem?)



Code:


Recording 2025840/10 {
  Version        = 29
  BitRate        = 0
  ErrorString    = {mfs_ftp insert}
  RecordQuality  = 100
  Score          = 100
  StartDate      = 13541
  StopDate       = 13541
  UsedBy         = 1
  RecordingBehavior = 2025840/11
  Showing        = 2025840/12
  Part           = 2025840/13
  StreamFileSize = 6400
  State          = 4
  StartTime      = 1
  StopTime       = 30
  ExpirationDate = 24855
  ExpirationTime = 0
  SelectionType  = 3
  NVisit         = 2
  NSecondsWatched = 27
  IndexUsed      = 2025840/12 2025840/11
  IndexPath      = /Recording/Active/1:13541:00001:2025840 /Recording/NowShowingByClassic/2:86458:99998:2025840:0 {/Recording/NowShowingByFlatTitle/COLOR BARS 601:86458:99998:2025840:0} {/Recording/NowShowingByBucketTitle/COLOR BARS 601:2025840:86458:99998:2025840:1:0:1} /DiskUsed/010:004:6400:2025840
}




rbautch said:


> Since it re-encodes at lower resolution, doesn't using HDTV2MPEG2 defeat the purpose of a High Definition test pattern?


My understanding of HDTVtoMPEG2 is that it is simply changing the container type from .ts to .mpg without re-encoding at a lower resolution. When I check properties on the converted file from within Windows Media Player, it shows resolution of 1920x1080 (see attachment). I did not realize there was a one-step solution to what I was trying to do.

Simply using FFMPEG to convert from ts to ty+ works great and saves a step. The file sizes come out exactly the same but errors out at the same place above.

Thanks again for all your help!
Jeff


----------



## rbautch

This version will supress errors if your show does not have an ActualShowing object, which should allow the script to finish.


----------



## jstoddard

rbautch said:


> This version will supress errors if your show does not have an ActualShowing object, which should allow the script to finish.


Bingo - worked perfectly. Thanks again for all your help


----------



## unclemoosh

rbautch said:


> Season passes will recreate the folders, but you'll have to manually add the existing shows to them. I'll add a check to make sure blank input gets rejected when removing shows from folders.


First, thanks for your work and willingness to share with all.

I have created a wishlist, let it record a few programs. The folder shows up on the Tivo, but not listed by the script. I'm runnning HDVR's with 6.2, zippered and tweaked.

Any suggestions?

Thanks.


----------



## rbautch

unclemoosh said:


> First, thanks for your work and willingness to share with all.
> 
> I have created a wishlist, let it record a few prorams. The folder shows up on the Tivo, but not listed by the script. I'm runnning HDVR's with 6.2, zippered and tweaked.
> 
> Any suggestions?
> 
> Thanks.


In the MFS module of tivowebplus, go to /Recording/NowShowingByBucketTitle and see if you can find your recording. If you can, click on it and post a screen capture here.


----------



## unclemoosh

rbautch said:


> In the MFS module of tivowebplus, go to /Recording/NowShowingByBucketTitle and see if you can find your recording. If you can, click on it and post a screen capture here.


Here it is:

Recording 467978/10 {
Version = 28
BitRate = 0
SelectionType = 3
Showing = 467978/12
SubPriority = 7
ExpirationDate = 13558
ExpirationTime = 64800
UsedBy = 1
StartPadding = 60
StartDate = 13557
StartTime = 61138
TunedSignalType = 6
ApgStreamType = 2
RecordingBehavior = 467978/11
EndPadding = 60
ActualShowing = 467978/16 467978/19
ProgramSource = 147778/-1
Part = 467978/13 467978/17 467978/18 467978/20
StopDate = 13557
StopTime = 63060
BitstreamFormat = 59 50344978 335675648 -2015482111 721420288 16777216 587202560 520093696 50344978 973209856 1460456193 251658240 67108864 33554432 50331648 65537
Score = 0
State = 4
StreamFileSize = 492544
IndexUsed = 467978/12 467978/11
IndexPath = /Recording/Active/1:13557:61138:467978 /Recording/NoReRecord/A2f59:2:99999:00467978 /Recording/TmsId/EP0021200222:86442:38861:467978 /Recording/NowShowingByClassic/2:86442:38861:467978:0 {/Recording/NowShowingByFlatTitle/HOME IMPROVEMENT:86442:38861:467978:0} {/Recording/NowShowingByBucketTitle/HOME IMPROVEMENT:15974:86442:38861:467978:2:0:1} /DiskUsed/010:003:492544:467978
}

Thanks.


----------



## rbautch

The script uses the "Series" object to group shows, so if you want to add shows to a folder, the script copies the Series object from a show that's already in the folder to your target show. The problem with wishlists is that each show may have a different Series object, and copying that object to your target show has no effect. There appears to be some other object that causes the grouping for wishlists. I studied the structure of a few wishlist recordings and compared them to a standard series recording. I found an object called "Theme" that contains the title of the wishlist, but it's imbedded in a "SeasonPass" object. I'll try to copy the Theme object to a new recording to see if that forces the grouping in the wishlist folder. I'm somewhat skeptical since it's linked to a SeasonPass object, which may bring some unwanted consequences.


----------



## unclemoosh

I must really be missing it. I am trying to get the clock in the upper right corner and am having fits getting it to work. I have HDVR2's Zippered and tweaked, running 6.2.

I can't get it to work properly. I get the string displayed, 'date +\%I:%\M" but not the time. Also having problems with the script setting "clock" and "TZ".

This shouldn't be this difficult. What am I missing?

Thanks.


----------



## rbautch

The clock script is broken and needs updating. BTW, this is the folder script thread, not the clock script thread.


----------



## 100Tbps

Hi rbautch,

I found a single post about this on ddb, but not a thread like this one. Is there a readme around? I'm happy to do my homework before posting, but I can't find one and it's not in the latest .zip file.

I'm curious - if I can rename a dummy folder and place some shows there (ones for which I have season passes), will newly recorded shows will be placed there automatically? I like the idea of grouping kid shows together, but would like them all dumped into a single folder and not have to move each episode. I know I could try this to see, but wanted to ask before I start meddling. Not sure if it would work, or create folders within folders (which would be fine with me).

This utility seems awesome! Thanks for your hard work.


----------



## rbautch

100Tbps said:


> Hi rbautch,
> 
> I found a single post about this on ddb, but not a thread like this one. Is there a readme around? I'm happy to do my homework before posting, but I can't find one and it's not in the latest .zip file.
> 
> I'm curious - if I can rename a dummy folder and place some shows there (ones for which I have season passes), will newly recorded shows will be placed there automatically? I like the idea of grouping kid shows together, but would like them all dumped into a single folder and not have to move each episode. I know I could try this to see, but wanted to ask before I start meddling. Not sure if it would work, or create folders within folders (which would be fine with me).
> 
> This utility seems awesome! Thanks for your hard work.


No readme for it, and not much need for one since the script prompts you for info when you run it. Newly recorded shows will not go directly into the new folder, so you'll have to put them in after the fact using the script.


----------



## mendodave

Hi

first off, thanks rbautch. this zippered and tweaked dtivo is awesome. :up: 

I have TWP, the 2.0 version, on my Dtivo, and created a few folders. Keepers, and Comedies. I moved shows into the folders, and I see them in the correct folders, but on the Dtivo itself I just see the NPL, stock, no folders.

Am I supposed to see the ones I created in TWP? I can always do the idea of recording a small amount of the same show, and rename it. I will try that tonight, but it seemed more likely that I was missing a clue

I have group by folders turned on in the dtivo....i think.

Thanks again!

david


----------



## HellFish

David,
You should ask this question in the TWP 2.0 support thread. The way you created the folders is not through this script. This thread is only for the folders.tcl script (which is already located in your enhancements folder if you used the zipper.) I had a similar problem, but found this script is much easier for how I need to manage my folders, so I didn't pursue the answer.


----------



## mendodave

HellFish said:


> David,
> You should ask this question in the TWP 2.0 support thread. The way you created the folders is not through this script. This thread is only for the folders.tcl script (which is already located in your enhancements folder if you used the zipper.) I had a similar problem, but found this script is much easier for how I need to manage my folders, so I didn't pursue the answer.


thanks, Fish.

Does the folders.tcl script allow viewing in the NPL on the Dtivo?

i started googling folders and dtivo, and ended up here, where i do have an account, so i asked the question here. but, you are correct.

david


----------



## HellFish

Yes it does allow the folders to be viewed in the NPL. And it is a very straight forward program. If you're using Tivoserver to transfer, after you are finished moving your shows/movies to the tivo, you can then run this script to do a search for them & place them in any folder you want to.
By reading your first post, you have the right idea. Did it work for you?


----------



## mendodave

HellFish said:


> Yes it does allow the folders to be viewed in the NPL. And it is a very straight forward program. If you're using Tivoserver to transfer, after you are finished moving your shows/movies to the tivo, you can then run this script to do a search for them & place them in any folder you want to.
> By reading your first post, you have the right idea. Did it work for you?


Hi Fish,

yes, it sure did. some of the movies, uh, downloaded from the PC via tivoserver have names like this:

""

if you choose that to play, you see the real name. Not all downloaded movies, just some. I am leaving them in the main list. It is a little clunkier than the TWP v2 method, but I want to view folders in the Dtivo list, that sucker is getting long! about 10 page down button presses.

I am trying to allow telnet access through my webramp ISDN and WRT54G system now, so I can do this from work, but it won't let me through yet.

Thanks!

david


----------



## Martin Tupper

Can folders.tcl be run from a single command line so that I could use a cronjob to move shows?


----------



## rbautch

Martin Tupper said:


> Can folders.tcl be run from a single command line so that I could use a cronjob to move shows?


Right now folder renaming can be done with arguments from a command line. It' not a bad idea though - automatically having shows go to specified folders as they're recorded. I'll add it to the hopper.


----------



## indi

I've been using folders.tcl with some success (luck?) to group shows xfered from my PC to DTivo. I could never get the "group" function to work in TWP or the filename.xml feature to work in TivoServer. (Edit later the same day: Well I DID finally get the grouping function to work on TWP, but it sure took a LOT of trial and error)

Would it be too difficult to make an interface to use this folders.tcl in TivoWebPlus?

Also some helpful features might be:

Display the shows already in a folder after you search and find it for the "Add Shows" (option 1).

Display what folder a show belongs to when "List all shows" (option 5). 

Option to "Make a new folder" based on what folders.tcl can find already existing on your tivo (something like an unused Series ID of a deleted file or something similar).

What is the format for listing multiple show titles to move (comma, comma-space, semi-colon, etc)?

Thanks for the great script...and all your help all over these boards with enhancements like this.

Indi in Phoenix, AZ USA


----------



## rbautch

Great ideas. I'll look into them when I have some time to experiment. As far as a TWP module, that's beyond my skills. Lgkahn on DDB developed the current folder functionality for Tivowebplus, and his work gave me some of the ideas for folders.tcl. I'll ask him if he's interested in collaborating on a new module that's a little more intuitive than the current functionality.


----------



## Soapm

rbautch said:


> Great ideas. I'll look into them when I have some time to experiment. As far as a TWP module, that's beyond my skills. Lgkahn on DDB developed the current folder functionality for Tivowebplus, and his work gave me some of the ideas for folders.tcl. I'll ask him if he's interested in collaborating on a new module that's a little more intuitive than the current functionality.


Any progress toward making this a module to TWP?


----------



## rbautch

Soapm said:


> Any progress toward making this a module to TWP?


I've been overhauling the script over the last few weeks to add many new features. Just needs to be tested a little more. Have not done anything with regard to TWP.


----------



## Soapm

rbautch said:


> I've been overhauling the script over the last few weeks to add many new features. Just needs to be tested a little more. Have not done anything with regard to TWP.


If I can help with testing let me know. I am going to put my Bilko series on my Tivo so will be using this app later today. What folder do I FTP the recording to?

I am going to run tweak.sh later also and will report about not assessing the folder. What was that command you wanted me to run again?


----------



## Da Goon

You can't use standard ftp to stick a show on your tivo. You'll need to convert the video to .ty or .tmf format using the patched ffmpeg from ddb and then use mfs_ftp to stick it in the tmf folder. Or you could use pytivo to send it to the tivo. Pytivo will convert the video on the fly.


----------



## Soapm

Da Goon said:


> You can't use standard ftp to stick a show on your tivo. You'll need to convert the video to .ty or .tmf format using the patched ffmpeg from ddb and *then use mfs_ftp to stick it in the tmf folder*. Or you could use pytivo to send it to the tivo. Pytivo will convert the video on the fly.


This part, you do mean using my FTP browser on my PC to place the converted files on the Tivo. Do I understand? I don't see a TMF folder, what is the drill down to it or am I missing the boat on what mfs_ftp is?


----------



## Barefooter

for RBautch:

Likewise If your looking for beta testers for the script. I would be happy to. One of the problems I am seeing is I can't move files to folders with 6.3e. Getting an exception on that. Let me know if you want that exception stack trace.

Regards,

Jim


----------



## HellFish

Soapm said:


> If I can help with testing let me know.


Ditto. I can do testing on 6.2/6.2a if need be. What kind of features _might be_ included in this overhaul? I think the script is great as is!


----------



## rbautch

Here are some of the new features I'm adding:

Add option for batch manipulating all the episodes in a folder, including title, airdate, actor, description, etc.

Add option to make episode 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.

Add option to reorder shows in a folder using season/episode notation. So show.S02E12.mpg appears before show.S03E09.mpg in NPL.


----------



## rbautch

Barefooter said:


> One of the problems I am seeing is I can't move files to folders with 6.3e. Getting an exception on that. Let me know if you want that exception stack trace.


Has anyone else experienced this behavior with 6.3e? Please post the full error message you get when trying to add a show to a folder.


----------



## Da Goon

rbautch said:


> Has anyone else experienced this behavior with 6.3e? Please post the full error message you get when trying to add a show to a folder.


I just relocated a whole bunch of shows on my 6.3e HR10 with no problem at all. I thought I'd seen somebody talking about this and just checked on ddb, and it looks like barefooter posted the error message towards the end of the main mfs_ftp thread.

edit - disregard previous edit - it works fine either way for me now


----------



## Barefooter

First my bad I have two HR10s one at 6.3c and one at 6.3e. Haven't tested with 6.3e yet. Will get to that today. Here is the output from the 6.3c script run.

I was attempting to take a show that was transfered from a 6.2a d* unit to the HR10 running 6.3c

bash-2.02# ./folders.tcl
Please select from the following:
1 Add show(s) to an existing folder.
2 Change the name of a folder.
3 Remove a show from a folder.
4 List all folders and folder IDs.
5 List all shows and recording IDs.
Enter the number corresponding to the action you want to perform: 1

Enter the name of the TARGET FOLDER you want to add shows to: Stargate SG-1
Searching for Stargate SG-1...............................
Found a folder named "Stargate SG-1" containing 2 episodes.
Enter the name (or part thereof) of the show(s) you want to add to this folder: Stargate
Found a matching show called "Stargate SG-1 - Proving Ground". Moving to "Stargate SG-1" folder...
Found a matching show called "Stargate SG-1 - The Fifth Race". Moving to "Stargate SG-1" folder...
no such object: 
while executing
"dbobj $actualprogram set EpisodeTitle $episodetitle"
invoked from within
"if { [string match *$showname* $title] } {
if { $episodetitle != "" } {
append titlea " -"
append episodetitlea "\"."
} els..."
("uplevel" body line 14)
invoked from within
"uplevel $body"
invoked from within
"transaction {uplevel $body}"
(procedure "RetryTransaction" line 5)
invoked from within
"RetryTransaction {
set rec [db $db openidconstruction $id]
set showing [dbobj $rec get Showing]
set actualshowing [lindex [dbobj $rec g..."
("uplevel" body line 2)
invoked from within
"uplevel $body"
invoked from within
"ForeachMfsFile id name type /Recording/NowShowingByBucketTitle "" {
RetryTransaction {
set rec [db $db openidconstruction $id]
set showin..."
invoked from within
"if {$selection == 1} {
puts ""
puts -nonewline stdout "Enter the name of the TARGET FOLDER you want to add shows to: "
flush stdout
set target..."
(file "./folders.tcl" line 43)


----------



## Barefooter

Ran the folders script on a 6.3e machine exact same error on the same line. Again please note. I am trying to add to a folder a show recorded on a 6.2 non HD D*tivo.

I also tried moving a show that was recorded on the 6.3e machine to a folder on that same machine and that works perfectly. As does removing it from the folder, folder rename and the list functions. 

Regards...


----------



## rbautch

Barefooter said:


> Ran the folders script on a 6.3e machine exact same error on the same line. Again please note. I am trying to add to a folder a show recorded on a 6.2 non HD D*tivo.
> 
> I also tried moving a show that was recorded on the 6.3e machine to a folder on that same machine and that works perfectly. As does removing it from the folder, folder rename and the list functions.
> 
> Regards...


That error cropped up with a few shows, and was discussed earlier in the thread. Try the version I posted here, which should fix it.


----------



## Barefooter

Sorry I missed that and caused the stir. Yup it works perfectly on 6.3e Thanks for a really great script !


----------



## HellFish

rbautch said:


> Here are some of the new features I'm adding:
> 
> Add option for batch manipulating all the episodes in a folder, including title, airdate, actor, description, etc.
> 
> Add option to make episode 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.
> 
> Add option to reorder shows in a folder using season/episode notation. So show.S02E12.mpg appears before show.S03E09.mpg in NPL.


 Sweet Jebus! Russ, if you have any of that done yet, let me know, I am definitely in a position where I would be able help you test several of those features.

Since most of them are not Folder related, it sounds like you should just make another awesome program called "ShowNames." If you can do all that, it would be a perfect compliment to TivoServer. Heck, TivoServer tried to get the friendly title formatting, but wasn't successful (at least in my experience).

*Edit:* rbautch has a new release of folders.tcl and started a new thread which can be found here:

Robust Folder Manipulation - folders.tcl

Instead of posting to this thread, I reccommend trying the latest release, and posting any comments there.


----------

