From 45e2b0325f89c472a29dab48ff89eebbc2f9b0a1 Mon Sep 17 00:00:00 2001 From: Bryan Schumaker Date: Thu, 14 Oct 2010 08:16:13 -0400 Subject: [PATCH] Filtering improvements When a list is filtered, if the Nth song is selected we should play song N in the filtered list and not the original list. --- libsaria/collection/collection.py | 5 ++++- ocarina/collection.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libsaria/collection/collection.py b/libsaria/collection/collection.py index 9d3f66cc..a773d8be 100644 --- a/libsaria/collection/collection.py +++ b/libsaria/collection/collection.py @@ -14,7 +14,10 @@ ins_tree = None class TrackRecord: def __init__(self, year, length, lenstr): self.length = length - self.lenstr = lenstr + if lenstr[0] == "0" and lenstr[1] == ":": + self.lenstr = lenstr[2:] + else: + self.lenstr = lenstr self.count = 0 self.year = year #self.like = None diff --git a/ocarina/collection.py b/ocarina/collection.py index 4afc23c2..863b7d33 100644 --- a/ocarina/collection.py +++ b/ocarina/collection.py @@ -51,7 +51,7 @@ class Collection(gtk.ScrolledWindow): list.set_value(list_iter, len(list_row)-1, "Played: %s"%string) def row_activated(self, widget, path, column): - list = self.list.list + list = self.list.filter_model iter = list.get_iter(path) row = list[iter] self.selected_row(row) @@ -79,6 +79,7 @@ class Library(Collection): return collection.lib_get_attr(row[0], "playcount") def select_row(self, row): + print row[0], row[1] collection.lib_play_id(row[0]) def filter(self, text):