From fec92ea03e41b826e1bd982a11ebcb7a412626ad Mon Sep 17 00:00:00 2001 From: Bas Stottelaar Date: Sun, 28 Dec 2014 13:36:03 +0100 Subject: [PATCH 1/3] Potential fix for #2055 --- headphones/lock.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/headphones/lock.py b/headphones/lock.py index 2fcc7ab7..1ec3f2c8 100644 --- a/headphones/lock.py +++ b/headphones/lock.py @@ -39,12 +39,12 @@ class TimedLock(object): sleep_amount = self.minimum_delta - delta if sleep_amount >= 0: # zero sleeps give the cpu a chance to task-switch - headphones.logger.info('Sleeping %s (interval)', sleep_amount) + headphones.logger.debug('Sleeping %s (interval)', sleep_amount) time.sleep(sleep_amount) while not self.queue.empty(): try: seconds = self.queue.get(False) - headphones.logger.info('Sleeping %s (queued)', seconds) + headphones.logger.debug('Sleeping %s (queued)', seconds) time.sleep(seconds) except Queue.Empty: continue @@ -59,15 +59,14 @@ class TimedLock(object): def snooze(self, seconds): """ - Asynchronously add time to the next request. - Can be called outside + Asynchronously add time to the next request. Can be called outside of the lock context, but it is possible for the next lock holder to not check the queue until after something adds time to it. """ - # we use a queue so that we don't have to synchronize + # We use a queue so that we don't have to synchronize # across threads and with or without locks headphones.logger.info('Adding %s to queue', seconds) - self.queue.add(seconds) + self.queue.put(seconds) class FakeLock(object): From 2d74797e863a57a2e204a6ab9f849d676ee8416d Mon Sep 17 00:00:00 2001 From: Robert Burden Date: Sun, 18 Jan 2015 01:19:22 -0500 Subject: [PATCH 2/3] Added API call getSnatched Added API call so you can get a list of what is currently being downloaded. --- headphones/api.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/headphones/api.py b/headphones/api.py index 7273c2ad..df9aa11a 100644 --- a/headphones/api.py +++ b/headphones/api.py @@ -18,7 +18,7 @@ from headphones import db, mb, updater, importer, searcher, cache, postprocessor import headphones import json -cmd_list = ['getIndex', 'getArtist', 'getAlbum', 'getUpcoming', 'getWanted', 'getSimilar', 'getHistory', 'getLogs', +cmd_list = ['getIndex', 'getArtist', 'getAlbum', 'getUpcoming', 'getWanted', 'getSnatched', 'getSimilar', 'getHistory', 'getLogs', 'findArtist', 'findAlbum', 'addArtist', 'delArtist', 'pauseArtist', 'resumeArtist', 'refreshArtist', 'addAlbum', 'queueAlbum', 'unqueueAlbum', 'forceSearch', 'forceProcess', 'forceActiveArtistsUpdate', 'getVersion', 'checkGithub','shutdown', 'restart', 'update', 'getArtistArt', 'getAlbumArt', @@ -166,6 +166,11 @@ class Api(object): "SELECT * from albums WHERE Status='Wanted'") return + def _getSnatched(self, **kwargs): + self.data = self._dic_from_query( + "SELECT * from albums WHERE Status='Snatched'") + return + def _getSimilar(self, **kwargs): self.data = self._dic_from_query('SELECT * from lastfmcloud') return From cf25fbc75d5d76926479646b491918efa00eb89d Mon Sep 17 00:00:00 2001 From: Bas Stottelaar Date: Thu, 5 Feb 2015 12:42:51 +0100 Subject: [PATCH 3/3] Release v0.5.4 --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55a99450..b38d3565 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Changelog -## v0.x.x -Released XX XX 2015 +## v0.5.4 +Released 05 February 2015 Highlights: * Added: backported 'Scan Artist' feature from `sarakha63/headphones` @@ -17,7 +17,7 @@ Highlights: * Improved: upgraded mutagen to 1.27 * Improved: upgraded beets to 1.3.10 -The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.3...v0.X.X). +The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.3...v0.5.4). ## v0.5.3 Released 15 January 2015