|
| Author |
Message |
choekstr

Joined: 06 Dec 2008 Posts: 144
|
Posted: Tue Jan 27, 2009 4:48 pm Post subject: |
|
|
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 |
|
 |
ebf
Joined: 22 Mar 2008 Posts: 123
|
|
| Back to top |
|
 |
wgw
Joined: 06 Jan 2008 Posts: 284
|
Posted: Wed Jan 28, 2009 1:37 am Post subject: |
|
|
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 |
|
 |
mikebridge
Joined: 29 Jan 2009 Posts: 3
|
Posted: Thu Jan 29, 2009 2:53 pm Post subject: |
|
|
| 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 |
|
 |
choekstr

Joined: 06 Dec 2008 Posts: 144
|
Posted: Thu Jan 29, 2009 3:06 pm Post subject: |
|
|
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 |
|
 |
ebf
Joined: 22 Mar 2008 Posts: 123
|
Posted: Thu Jan 29, 2009 3:44 pm Post subject: |
|
|
| 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 |
|
 |
mikebridge
Joined: 29 Jan 2009 Posts: 3
|
Posted: Thu Jan 29, 2009 11:42 pm Post subject: |
|
|
| 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 |
|
 |
choekstr

Joined: 06 Dec 2008 Posts: 144
|
Posted: Thu Jan 29, 2009 11:51 pm Post subject: |
|
|
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 |
|
 |
wgw
Joined: 06 Jan 2008 Posts: 284
|
|
| Back to top |
|
 |
danimal4326
Joined: 14 Apr 2008 Posts: 38
|
Posted: Tue Mar 03, 2009 1:12 am Post subject: |
|
|
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 |
|
 |
danimal4326
Joined: 14 Apr 2008 Posts: 38
|
Posted: Tue Mar 03, 2009 5:32 am Post subject: |
|
|
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 |
|
 |
wmcbrine

Joined: 04 Jan 2008 Posts: 1226
|
Posted: Tue Mar 03, 2009 12:33 pm Post subject: |
|
|
| 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 |
|
 |
StanSimmons
Joined: 04 Jan 2008 Posts: 11
|
Posted: Tue Mar 03, 2009 9:44 pm Post subject: |
|
|
| 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 |
|
 |
Eccles
Joined: 14 Feb 2009 Posts: 33
|
Posted: Tue Mar 03, 2009 9:51 pm Post subject: |
|
|
| 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 |
|
 |
wmcbrine

Joined: 04 Jan 2008 Posts: 1226
|
Posted: Tue Mar 03, 2009 10:47 pm Post subject: |
|
|
| 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 |
|
 |
|