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
choekstr



Joined: 06 Dec 2008
Posts: 144

PostPosted: Tue Jan 27, 2009 4:48 pm    Post subject: Reply with quote

First, subfolders do not allow for sorting per Tivo. It looks like the sorting for subfolders is now default by date.

Perhaps if we have the option to sort by alpha or date as was recently added but change the default sorting so that the non sortable subfolders retain the alpha sorting method?

I would absolutely hate to loose the sort by date option and IMO it is a feature on the Tivo and therefore should not be ignored as it was in the past but either a change to the subfolder sorting (default sorting?) or an option to turn it off alltogether in the config file.

--
Chris
Back to top
View user's profile Send private message
ebf



Joined: 22 Mar 2008
Posts: 123

PostPosted: Tue Jan 27, 2009 6:37 pm    Post subject: Reply with quote

wgw wrote:
I find it annoying too. But more importantly, when I go to a subfolder, it does not retain my sort by name setting. The sort is all out of wack in the subfolders. Seems to be totally random.

I guess subfolders are another thing. I understand why it happens from the discussion earlier in this thread, but understanding does not keep it from being a pain! Smile
Back to top
View user's profile Send private message
wgw



Joined: 06 Jan 2008
Posts: 284

PostPosted: Wed Jan 28, 2009 1:37 am    Post subject: Reply with quote

Well, I do like the idea, but I'm removing this patch from my branch until we can perfect the subfolder support for name and date sorts. My branch is now updated. Sorry guys. Would you take a closer look and see if you can make this work for all subfolders?
_________________
Download pyTivo
my pyTivo branch
Back to top
View user's profile Send private message
mikebridge



Joined: 29 Jan 2009
Posts: 3

PostPosted: Thu Jan 29, 2009 2:53 pm    Post subject: Reply with quote

could i suggest at least the option, when the date code goes back in, to use the OAD in the metadata file instead of the file creation date?
Back to top
View user's profile Send private message
choekstr



Joined: 06 Dec 2008
Posts: 144

PostPosted: Thu Jan 29, 2009 3:06 pm    Post subject: Reply with quote

I have to admit I have used my own patch to an older version but I implemented mtime (modified time) instead of ctime (create time) that was initially proposed.

Are you eluding that the forks were implemented with ctime? ACK!
Back to top
View user's profile Send private message
ebf



Joined: 22 Mar 2008
Posts: 123

PostPosted: Thu Jan 29, 2009 3:44 pm    Post subject: Reply with quote

mikebridge wrote:
could i suggest at least the option, when the date code goes back in, to use the OAD in the metadata file instead of the file creation date?

(If we got a flag in the config) I would vote (twice) for this option. It is the most logical to me for episodes of programs.
Back to top
View user's profile Send private message
mikebridge



Joined: 29 Jan 2009
Posts: 3

PostPosted: Thu Jan 29, 2009 11:42 pm    Post subject: Reply with quote

ebf wrote:
mikebridge wrote:
could i suggest at least the option, when the date code goes back in, to use the OAD in the metadata file instead of the file creation date?

(If we got a flag in the config) I would vote (twice) for this option. It is the most logical to me for episodes of programs.


hell, i'll be greedy and hope for an option per share instead of a global setting, with the ability to override the setting with a metadata file in a sub directory off the main share :p
Back to top
View user's profile Send private message
choekstr



Joined: 06 Dec 2008
Posts: 144

PostPosted: Thu Jan 29, 2009 11:51 pm    Post subject: Reply with quote

It does look like there is a default setting when certain conditions are met but this bit of python is a bit beyond me in how it actually works. I get the sort routines but when does Random sortorder occur, or !CaptureDate. My guess is in theory we could have per share sort methods with a variable pulled from the config file and passed along to this routine. I was hoping someone more versed in python and a *real* developer could beef this up to hopefully appease the majority and get this back into the builds.

Code:
        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)
Back to top
View user's profile Send private message
wgw



Joined: 06 Jan 2008
Posts: 284

PostPosted: Fri Jan 30, 2009 2:27 am    Post subject: Reply with quote

mikebridge wrote:
could i suggest at least the option, when the date code goes back in, to use the OAD in the metadata file instead of the file creation date?


Agreed, when I reverted I noticed it was using file date instead of OAD. Neither current functionality gives me a warm fuzzy. Shocked Confused

_________________
Download pyTivo
my pyTivo branch
Back to top
View user's profile Send private message
danimal4326



Joined: 14 Apr 2008
Posts: 38

PostPosted: Tue Mar 03, 2009 1:12 am    Post subject: Reply with quote

For anyone who is still using a modified plugin.py to allow sorting by name,
here's a modified version or "name_sort" that disregards "The" at the beginning of titles:

Code:

def name_sort(x, y):
    if x.startswith('The ') or x.startswith('the '):
        x = x.strip('[tT]he '
    if y.startswith('The ') or y.startswith('the '):
        y = y.strip('[tT]he '

    return cmp(x, y)

Back to top
View user's profile Send private message
danimal4326



Joined: 14 Apr 2008
Posts: 38

PostPosted: Tue Mar 03, 2009 5:32 am    Post subject: Reply with quote

Sorry, disregard the previous code.. Just retested this one and works like a charm.. for upper and lowercase 'the'

Of course all my files have spaces i.e "The Movie Title.mkv"

I was just tired of looking for a movie by title and then finding a big chunk of em starting with 'The'

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)



Does anyone know why the sort is re-done everytime the tivo does a page-up or down? I wonder if that is why it takes so long.. my movie dir has 200 some files..
Back to top
View user's profile Send private message
wmcbrine



Joined: 04 Jan 2008
Posts: 1226

PostPosted: Tue Mar 03, 2009 12:33 pm    Post subject: Reply with quote

danimal4326 wrote:
Does anyone know why the sort is re-done everytime the tivo does a page-up or down?

Yeah... it's related to pyTivo's ability to recognize the addition of new files without restarting it (something I could personally live without, but which is apparently a big deal to some). If the sorted file list were cached, you wouldn't see a new file in that directory, until the cache was thrown away.

Of course there are more intelligent approaches to take than just not caching. Let me see what I can come up with...

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



Joined: 04 Jan 2008
Posts: 11

PostPosted: Tue Mar 03, 2009 9:44 pm    Post subject: Reply with quote

wmcbrine wrote:
danimal4326 wrote:
Does anyone know why the sort is re-done everytime the tivo does a page-up or down?

Yeah... it's related to pyTivo's ability to recognize the addition of new files without restarting it (something I could personally live without, but which is apparently a big deal to some). If the sorted file list were cached, you wouldn't see a new file in that directory, until the cache was thrown away.

Of course there are more intelligent approaches to take than just not caching. Let me see what I can come up with...


Yea! I have several folders that are over 100 shows long and it is frustrating when pyTivo goes back to the top of the first page when you left-arrow out of a show.
Back to top
View user's profile Send private message
Eccles



Joined: 14 Feb 2009
Posts: 33

PostPosted: Tue Mar 03, 2009 9:51 pm    Post subject: Reply with quote

wmcbrine wrote:
Of course there are more intelligent approaches to take than just not caching. Let me see what I can come up with...
FWIW, I vote for caching the directory once when you enter it, and working from that cache until the user left-arrows out and re-enters the directory (at which time, take a fresh snapshot).
Back to top
View user's profile Send private message
wmcbrine



Joined: 04 Jan 2008
Posts: 1226

PostPosted: Tue Mar 03, 2009 10:47 pm    Post subject: Reply with quote

StanSimmons wrote:
Yea! I have several folders that are over 100 shows long and it is frustrating when pyTivo goes back to the top of the first page when you left-arrow out of a show.

Uh, that's a different issue. That's the TiVo forgetting where it was... I don't think there's anything we can do about that.

_________________
My pyTivo fork
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 3 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.1253s ][ Queries: 12 (0.0162s) ][ Debug on ]