From 9b8c56a64649347db6ecce025957e9a95219bb3f Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Fri, 24 Aug 2012 20:39:55 -0700 Subject: [PATCH] remove Tomahawk resolver The resolver is now maintained in the central Tomahawk resolver repository at: https://github.com/tomahawk-player/tomahawk-resolvers --- extra/beets-resolver/README.md | 15 ----- extra/beets-resolver/beets.js | 102 --------------------------------- extra/beets-resolver/config.ui | 76 ------------------------ 3 files changed, 193 deletions(-) delete mode 100644 extra/beets-resolver/README.md delete mode 100644 extra/beets-resolver/beets.js delete mode 100644 extra/beets-resolver/config.ui diff --git a/extra/beets-resolver/README.md b/extra/beets-resolver/README.md deleted file mode 100644 index e0b36f237..000000000 --- a/extra/beets-resolver/README.md +++ /dev/null @@ -1,15 +0,0 @@ -beets Tomahawk resolver -======================= - -This is a script resolver for [Tomahawk][tomahawk player] that hooks into -[beets][beets music manager]. It uses [beets' web plugin][] to access your -beets library remotely. - -To use it, just start ``beet web`` on the machine with your music and load this -resolver on the machine running Tomahawk. Use the configuration button on the -resolver to set the hostname and port of the beets server (these default to -localhost:8337). You should be able to start playing music immediately. - -[beets' web plugin]: http://beets.readthedocs.org/en/latest/plugins/web.html -[beets music manager]: http://beets.radbox.org/ -[tomahawk player]: http://tomahawk-player.org/ diff --git a/extra/beets-resolver/beets.js b/extra/beets-resolver/beets.js deleted file mode 100644 index a66474316..000000000 --- a/extra/beets-resolver/beets.js +++ /dev/null @@ -1,102 +0,0 @@ -var BeetsResolver = Tomahawk.extend(TomahawkResolver, -{ - // Basic setup. - settings: - { - name: 'beets', - weight: 95, - timeout: 5 - }, - - // Resolution. - resolve: function( qid, artist, album, title ) - { - this.beetsQuery(qid, - ['artist:' + artist, 'album:' + album, 'title:' + title] - ); - }, - search: function( qid, searchString ) - { - this.beetsQuery(qid, searchString.split(' ')); - }, - baseUrl: function() { - return 'http://' + this.host + ':' + this.port; - }, - beetsQuery: function( qid, queryParts ) - { - var baseUrl = this.baseUrl(); - var url = baseUrl + '/item/query/'; - for (var i = 0; i < queryParts.length; ++i) { - url += encodeURIComponent(queryParts[i]); - url += '/'; - } - url = url.substring(0, url.length - 1); // Remove last /. - - Tomahawk.asyncRequest(url, function(xhr) { - var resp = JSON.parse(xhr.responseText); - var items = resp['results']; - - var searchResults = []; - for (var i = 0; i < items.length; ++i) { - item = items[i]; - searchResults.push({ - artist: item['artist'], - album: item['album'], - track: item['title'], - albumpos: item['track'], - source: "beets", - url: baseUrl + '/item/' + item['id'] + '/file', - bitrate: Math.floor(item['bitrate'] / 1024), - duration: Math.floor(item['length']), - size: 83375, //! - score: 1.0, - extension: "mp3", //! - mimetype: "audio/mpeg", //! - year: item['year'] - }); - } - - Tomahawk.addTrackResults({ - qid: qid, - results: searchResults - }) - }); - }, - - // Configuration. - getConfigUi: function () { - var uiData = Tomahawk.readBase64("config.ui"); - return { - "widget": uiData, - "fields": [{ - name: "host", - widget: "hostField", - property: "text" - }, { - name: "port", - widget: "portField", - property: "text" - }] - }; - }, - newConfigSaved: function () { - var userConfig = this.getUserConfig(); - - this.host = userConfig.host || 'localhost'; - - var port = userConfig.port; - port = parseInt(port); - if (isNaN(port) || !port) { - port = 8337; - } - userConfig.port = port; - - this.port = port; - }, - - // Defaults. - host: 'localhost', - port: 8337 -}); - -Tomahawk.resolver.instance = BeetsResolver; diff --git a/extra/beets-resolver/config.ui b/extra/beets-resolver/config.ui deleted file mode 100644 index e7f079720..000000000 --- a/extra/beets-resolver/config.ui +++ /dev/null @@ -1,76 +0,0 @@ - - - Form - - - - 0 - 0 - 300 - 80 - - - - - 300 - 80 - - - - Form - - - - - 10 - 20 - 281 - 61 - - - - - QFormLayout::FieldsStayAtSizeHint - - - - - Host - - - - - - - - - - localhost - - - - - - - Port - - - - - - - - - - 8337 - - - - - - layoutWidget - portField - - - -