pyTivo Discussion Forum Forum Index pyTivo Discussion Forum
Answers and the development of pyTivo a TiVo transcoding server
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sorting
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    pyTivo Discussion Forum Forum Index -> pyTivo
 View previous topic :: View next topic  
Author Message
burnside



Joined: 19 Jan 2009
Posts: 27

PostPosted: Sat Apr 04, 2009 11:44 pm    Post subject: Reply with quote

So is there anyway we can get sorting by name in the subfolders? I have my movies stored into folders in the root level as so:

A-B
C-D
E-H
...and so on

When I go into any of these folders, then the sorting is by date. I was in the E-H folder, looking for Eastern Promises and could not find it, but then realized it was one of the first DVDs I ripped when I installed pyTivo. Sure enough, at the bottom of the folder was Eastern Promises. It's just a pain to have to remember when you first ripped a DVD to know where it should show up in the sorting order for that folder.

What do you think?
Back to top
View user's profile Send private message
wmcbrine



Joined: 04 Jan 2008
Posts: 1601

PostPosted: Sat Apr 04, 2009 11:53 pm    Post subject: Reply with quote

The TiVo just doesn't offer (nor preserve) the sort options in the submenus. You'd either have to save some state information across requests (bad in many ways), always sort subfolders alpha (ugh), or else have a per-share config option to force alpha sorting. I'm reluctantly leaning towards the last, as perhaps the least of the available evils.
_________________
My pyTivo fork
Back to top
View user's profile Send private message
burnside



Joined: 19 Jan 2009
Posts: 27

PostPosted: Sat Apr 04, 2009 11:56 pm    Post subject: Reply with quote

Man, thanks for your fast reply. So for that last option, could you explain it a bit more?
Back to top
View user's profile Send private message
burnside



Joined: 19 Jan 2009
Posts: 27

PostPosted: Sun Apr 05, 2009 12:22 am    Post subject: Reply with quote

Wait, do you meant create shares for A-B, C-D, and so on? If so, would all those shares be on the root of the NPL or can I through those shares into a one share on the NPL?
Back to top
View user's profile Send private message
wmcbrine



Joined: 04 Jan 2008
Posts: 1601

PostPosted: Sun Apr 05, 2009 12:43 am    Post subject: Reply with quote

No. I just mean:

[Movies]
type = video
path = /where/ev/er
sort = alpha

or something along those lines. Then that share would always be sorted alpha (the old pyTivo behavior).

_________________
My pyTivo fork
Back to top
View user's profile Send private message
burnside



Joined: 19 Jan 2009
Posts: 27

PostPosted: Sun Apr 05, 2009 4:20 am    Post subject: Reply with quote

But that still wouldn't work for subfolders, right? This is what I have:

[Movie Server]
sort = alpha
type = video
path = D:\Videos\Movies

And it still does not sort the subfolders alpha.
Back to top
View user's profile Send private message
rdian06



Joined: 12 Apr 2008
Posts: 1420

PostPosted: Sun Apr 05, 2009 4:39 am    Post subject: Reply with quote

Umm, wmcbrine is talking about possibly adding that option in the future. The code to do that currently doesn't exist so adding it to your conf will NOT work.
Back to top
View user's profile Send private message
burnside



Joined: 19 Jan 2009
Posts: 27

PostPosted: Sun Apr 05, 2009 4:59 am    Post subject: Reply with quote

Oops... sorry bout that. I do like that option though!
Back to top
View user's profile Send private message
rjmitche



Joined: 05 Jan 2008
Posts: 47

PostPosted: Sat Apr 11, 2009 3:57 pm    Post subject: Reply with quote

I'll register another vote for doing something that allows sort to be alphabetic in subfolders (the per-share setting may be the best compromise). Most of my shares/subfolders contain movies and sorting by date doesn't make a lot of sense for movies.

I've resisted updating pyTivo since the sort was changed but, I'm getting tempted by some of the later mods....
Back to top
View user's profile Send private message
Tekniqal



Joined: 11 Apr 2009
Posts: 4

PostPosted: Sat Apr 11, 2009 10:25 pm    Post subject: Reply with quote

I am sorry if I missed it in one of the pages above but has anyone noticed that when you sort by name it puts all the capitalized titles first and then starts over with lower case. Really annoying to say the least. Lets say I have Lost.S05E12 and then lost.s05e10 they will be in completely different places in the list. Folders do the same thing so Las Vegas Season 1 is in a completely different place than las vegas season 2.
Back to top
View user's profile Send private message AIM Address
ebf



Joined: 22 Mar 2008
Posts: 133

PostPosted: Sun Apr 19, 2009 5:54 pm    Post subject: Reply with quote

Can someone remind me how to revert to the original name sort in all share folders? I just upgraded my install and overwrote my modified plugin.py file.
Back to top
View user's profile Send private message
choekstr



Joined: 06 Dec 2008
Posts: 152

PostPosted: Sun Apr 19, 2009 6:55 pm    Post subject: Reply with quote

Either hit enter and choose alphabetical sort or hit "1" for a hotkey toggle.
Back to top
View user's profile Send private message
ebf



Joined: 22 Mar 2008
Posts: 133

PostPosted: Sun Apr 19, 2009 7:22 pm    Post subject: Reply with quote

ebf wrote:
Can someone remind me how to revert to the original name sort in all share folders? I just upgraded my install and overwrote my modified plugin.py file.

I figured it out... Replace:


Code:
        def name_sort(x, y):
            return cmp(x, y)
        def date_sort(x, y):
            return cmp(os.stat(y).st_mtime, os.stat(x).st_mtime)

        if query.get('SortOrder', ['Normal'])[0] == 'Random':
            seed = query.get('RandomSeed', ['1'])[0]
            self.random_lock.acquire()
            random.seed(seed)
            random.shuffle(files)
            self.random_lock.release()
        elif query.get('SortOrder', ['Normal'])[0] == '!CaptureDate':
            files.sort(date_sort)
        else:
            files.sort(dir_sort)


With:

Code:
        def name_sort(x, y):
            return cmp(x, y)
        if query.get('SortOrder',['Normal'])[0] == 'Random':
            seed = query.get('RandomSeed', ['1'])[0]
            self.random_lock.acquire()
            random.seed(seed)
            random.shuffle(files)
            self.random_lock.release()
        else:
            files.sort(dir_sort)
[/code]
Back to top
View user's profile Send private message
ebf



Joined: 22 Mar 2008
Posts: 133

PostPosted: Sun Apr 19, 2009 7:45 pm    Post subject: Reply with quote

choekstr wrote:
Either hit enter and choose alphabetical sort or hit "1" for a hotkey toggle.

Since the date sort method cannot be controlled in subfolders, I wanted to go back to the original, always alpha method.
Back to top
View user's profile Send private message
KevinSartori



Joined: 08 Feb 2009
Posts: 27

PostPosted: Sun Apr 19, 2009 9:41 pm    Post subject: Reply with quote

Excellent tip, ebf! I've discovered that your method can be combined with danimal4326's tip (posted on Mon Mar 02, 2009 8:12 pm in this thread) to also ignore "The" when sorting.

For those who want both, open plugin.py with notepad or whatever and scroll to the bottom.

Replace:

Code:
        def name_sort(x, y):
            return cmp(x, y)

        def date_sort(x, y):
            return cmp(os.stat(y).st_mtime, os.stat(x).st_mtime)

        if query.get('SortOrder', ['Normal'])[0] == 'Random':
            seed = query.get('RandomSeed', ['1'])[0]
            self.random_lock.acquire()
            random.seed(seed)
            random.shuffle(files)
            self.random_lock.release()
        elif query.get('SortOrder', ['Normal'])[0] == '!CaptureDate':
            files.sort(date_sort)
        else:
            files.sort(dir_sort)


With:

Code:
        def name_sort(x, y):
            (tmp,x) = os.path.split(x)
            (tmp,y) = os.path.split(y)
            if x.title().startswith('The '):
                x = x.title().replace('The ', '')
            if y.title().startswith('The '):
                y = y.title().replace('The ', '')
            return cmp(x, y)

        if query.get('SortOrder', ['Normal'])[0] == 'Random':
            seed = query.get('RandomSeed', ['1'])[0]
            self.random_lock.acquire()
            random.seed(seed)
            random.shuffle(files)
            self.random_lock.release()
        else:
            files.sort(dir_sort)


To me, this is by far the most sensible method: sort both the folder names and their content alphabetically, while ignoring "The".

Thanks guys!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    pyTivo Discussion Forum Forum Index -> pyTivo All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 4 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Site is in NO WAY affiliated with TiVo Inc

Powered by phpBB © 2001, 2005 phpBB Group
phpBB SEO

Get pytivo at SourceForge.net. Fast, secure and Free Open Source software downloads
[ Time: 0.6546s ][ Queries: 12 (0.0434s) ][ GZIP on - Debug on ]