mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-21 11:05:32 +01:00
added interface for importLastFMTag
This commit is contained in:
@@ -87,7 +87,27 @@
|
||||
</fieldset>
|
||||
<input type="button" value="Save changes" onclick="doAjaxCall('importLastFM',$(this),'tabs',true);return false;" data-success="Last.fm artists will be imported" data-error="Fill in a last.fm username"/>
|
||||
</form>
|
||||
</div>
|
||||
<br/>
|
||||
<form action="importLastFMTag" method="GET" id="importLastFMTag">
|
||||
<fieldset>
|
||||
<legend>Import Last.FM Tag</legend>
|
||||
<p>Enter tag from which you want import top artists:</p>
|
||||
<br/>
|
||||
<div class="row">
|
||||
<label>Tag</label>
|
||||
<input type="text" value="" onfocus="if
|
||||
(this.value==this.defaultValue) this.value='';" name="tag" id="tag" size="18" />
|
||||
<br/>
|
||||
<label>Limit</label>
|
||||
<input type="text" value="50" onfocus="if
|
||||
(this.value==this.defaultValue) this.value='';" name="limit" id="limit" size="18" />
|
||||
</div>
|
||||
</fieldset>
|
||||
<input type="submit" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="tabs-3" class="configtable">
|
||||
<fieldset>
|
||||
|
||||
@@ -158,7 +158,7 @@ def getTagTopArtists(tag, limit=50):
|
||||
from headphones import importer
|
||||
|
||||
for artistid in artistlist:
|
||||
importet.addArtisttoDB(artistid)
|
||||
importer.addArtisttoDB(artistid)
|
||||
|
||||
|
||||
def getAlbumDescription(rgid, artist, album):
|
||||
|
||||
@@ -352,6 +352,12 @@ class WebInterface(object):
|
||||
raise cherrypy.HTTPRedirect("home")
|
||||
importLastFM.exposed = True
|
||||
|
||||
def importLastFMTag(self, tag, limit):
|
||||
threading.Thread(target=lastfm.getTagTopArtists, args=(tag, limit)).start()
|
||||
time.sleep(10)
|
||||
raise cherrypy.HTTPRedirect("home")
|
||||
importLastFMTag.exposed = True
|
||||
|
||||
def importItunes(self, path):
|
||||
headphones.PATH_TO_XML = path
|
||||
headphones.config_write()
|
||||
|
||||
Reference in New Issue
Block a user