From 7f56277c40d760948dc4383ad9c9e8ea313752e6 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Mon, 8 Oct 2012 21:34:02 +0100 Subject: [PATCH 1/3] Properly pass the cache size when initializing a db connection --- headphones/db.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/headphones/db.py b/headphones/db.py index 985f6b72..871b7c99 100644 --- a/headphones/db.py +++ b/headphones/db.py @@ -33,6 +33,9 @@ db_lock = threading.Lock() def dbFilename(filename="headphones.db"): return os.path.join(headphones.DATA_DIR, filename) + +def getCacheSize(): + return int(headphones.CACHE_SIZEMB) class DBConnection: @@ -45,7 +48,7 @@ class DBConnection: #journal disabled since we never do rollbacks self.connection.execute("PRAGMA journal_mode = OFF") #64mb of cache memory,probably need to make it user configurable - self.connection.execute("PRAGMA cache_size=-%s" % (headphones.CACHE_SIZEMB*1024)) + self.connection.execute("PRAGMA cache_size=-%s" % (getCacheSize()*1024)) self.connection.row_factory = sqlite3.Row def action(self, query, args=None): From 542d8b9e1f152798509dffba10c6d580b4e8bb26 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Mon, 8 Oct 2012 21:44:57 +0100 Subject: [PATCH 2/3] Changed default sorting on log page to show most recent first, changed default loglines to 25 from 10 per page --- data/interfaces/default/logs.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/interfaces/default/logs.html b/data/interfaces/default/logs.html index ca45712c..0f3fb8e5 100644 --- a/data/interfaces/default/logs.html +++ b/data/interfaces/default/logs.html @@ -45,6 +45,8 @@ $(document).ready(function() { "bServerSide": true, "sAjaxSource": 'getLog', "sPaginationType": "full_numbers", + "aaSorting": [[0, 'desc']], + "iDisplayLength": 25, "bStateSave": true, "oLanguage": { "sSearch":"", @@ -93,4 +95,4 @@ $(document).ready(function() { } } - \ No newline at end of file + From 6bd5d8d40b994ea0d20c97b0c273468648f5b245 Mon Sep 17 00:00:00 2001 From: Joe McWilliams Date: Mon, 8 Oct 2012 18:11:21 -0400 Subject: [PATCH 3/3] http_root won't work with absolute album artwork path --- data/interfaces/default/album.html | 2 +- data/interfaces/default/artist.html | 2 +- data/interfaces/default/index.html | 2 +- data/interfaces/default/manageartists.html | 2 +- data/interfaces/default/upcoming.html | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data/interfaces/default/album.html b/data/interfaces/default/album.html index bf52cc56..4da9323a 100644 --- a/data/interfaces/default/album.html +++ b/data/interfaces/default/album.html @@ -51,7 +51,7 @@
- +

${album['AlbumTitle']}

diff --git a/data/interfaces/default/artist.html b/data/interfaces/default/artist.html index ba40cb49..e891b1fa 100644 --- a/data/interfaces/default/artist.html +++ b/data/interfaces/default/artist.html @@ -122,7 +122,7 @@ %> - + ${album['AlbumTitle']} ${album['ReleaseDate']} ${album['Type']} diff --git a/data/interfaces/default/index.html b/data/interfaces/default/index.html index 9148e578..d31d94c7 100644 --- a/data/interfaces/default/index.html +++ b/data/interfaces/default/index.html @@ -35,7 +35,7 @@ "aTargets": [ 0 ], "mData":"ArtistID", "mRender": function ( data, type, full ) { - return '
'; + return '
'; } }, { diff --git a/data/interfaces/default/manageartists.html b/data/interfaces/default/manageartists.html index d1956d3c..d447a2c2 100644 --- a/data/interfaces/default/manageartists.html +++ b/data/interfaces/default/manageartists.html @@ -66,7 +66,7 @@ %> -
+
${artist['ArtistName']} ${artist['Status']} ${albumdisplay} diff --git a/data/interfaces/default/upcoming.html b/data/interfaces/default/upcoming.html index 585ac39b..25841069 100644 --- a/data/interfaces/default/upcoming.html +++ b/data/interfaces/default/upcoming.html @@ -40,7 +40,7 @@ %for album in wanted: - + ${album['ArtistName']} ${album['AlbumTitle']} ${album['ReleaseDate']} @@ -70,7 +70,7 @@ %for album in upcoming: - + ${album['ArtistName']} ${album['AlbumTitle']} ${album['ReleaseDate']}