mirror of
https://github.com/fergalmoran/picard.git
synced 2026-01-06 16:44:06 +00:00
Fixed web-service error caused PUID submissions. (#2842)
This commit is contained in:
1
NEWS.txt
1
NEWS.txt
@@ -3,6 +3,7 @@ Version 0.9.0beta1 - 2007-05-XX
|
||||
* F1 for Help instead of CTRL+H on Windows and Linux. (#2485, Nikolai Prokoschenko)
|
||||
* Tabbing focus transition from search isn't as expected. (#2546, Nikolai Prokoschenko)
|
||||
* Display an error message if launching a web browser failed.
|
||||
* Fixed web-service error caused PUID submissions.
|
||||
|
||||
Version 0.9.0alpha9 - 2007-05-12
|
||||
* New Features:
|
||||
|
||||
@@ -29,6 +29,7 @@ import sha
|
||||
from PyQt4 import QtCore, QtNetwork, QtXml
|
||||
from picard import version_string
|
||||
from picard.util import partial
|
||||
from picard.const import PUID_SUBMIT_HOST, PUID_SUBMIT_PORT
|
||||
|
||||
|
||||
def _escape_lucene_query(text):
|
||||
@@ -195,7 +196,7 @@ class XmlWebService(QtNetwork.QHttp):
|
||||
digest['username'] = username
|
||||
header = self.currentRequest()
|
||||
header.setValue('Authorization', 'Digest ' + ', '.join(['%s="%s"' % a for a in digest.items()]))
|
||||
self.setHost(self.config.setting["server_host"], self.config.setting["server_port"])
|
||||
self.setHost(PUID_SUBMIT_HOST, PUID_SUBMIT_PORT)
|
||||
requestid = self.request(header, data)
|
||||
self._request_handlers[requestid] = (handler, True)
|
||||
|
||||
@@ -294,13 +295,16 @@ class XmlWebService(QtNetwork.QHttp):
|
||||
def find_tracks(self, handler, **kwargs):
|
||||
self._find('track', handler, kwargs)
|
||||
|
||||
def submit_puids(self, puids, handler):
|
||||
from picard.const import PUID_SUBMIT_HOST, PUID_SUBMIT_PORT
|
||||
def _submit_puids(self, puids, handler):
|
||||
data = ('client=MusicBrainz Picard-%s&' % version_string) + '&'.join(['puid=%s%%20%s' % i for i in puids.items()])
|
||||
header = self._prepare("POST", PUID_SUBMIT_HOST, PUID_SUBMIT_PORT, '/ws/1/track/')
|
||||
requestid = self.request(header, None)
|
||||
self._puid_data[requestid] = data.encode('ascii', 'ignore'), handler
|
||||
|
||||
def submit_puids(self, puids, handler):
|
||||
func = partial(self._submit_puids, puids, handler)
|
||||
self.add_task(func)
|
||||
|
||||
def query_musicdns(self, handler, **kwargs):
|
||||
host = 'ofa.musicdns.org'
|
||||
port = 80
|
||||
@@ -316,4 +320,3 @@ class XmlWebService(QtNetwork.QHttp):
|
||||
def cleanup(self):
|
||||
# FIXME remove old cache entries
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user