Patch to make Ampache server work with 3.4.x and 3.5.x Authentication models

Karl Vollmer vollmer at ampache.org
Wed Feb 18 18:03:17 CET 2009


Quickly made the int changes over lunch here, and cleaned up some of
the debug. I haven't had a chance to look at the HACKING dock
referenced, will do for any future patches thanks for pointing it out.

As for the Qstring("<server>") yes I was following the pattern most of
the code was cut/paste :S, is there a preference on which way to go?
If that's in the HACKING dock ignore me, and I'll see it when I read
it.

See new patch file. This has been tested against Ampache 3.4.4
(current stable) and Ampache 3.5.x (current SVN) and it worked like a
charm.

-Karl

On Wed, Feb 18, 2009 at 1:57 AM, Dan Meltzer
<parallelgrapefruit at gmail.com> wrote:
> YOU WERE SUPPOSED TO BE SUBSCRIBED!
>
>
> ---------- Forwarded message ----------
> From: Dan Meltzer <parallelgrapefruit at gmail.com>
> Date: Tue, Feb 17, 2009 at 7:54 PM
> Subject: Re: Patch to make Ampache server work with 3.4.x and 3.5.x
> Authentication models
> To: amarok-devel at kde.org
>
>
> On Tue, Feb 17, 2009 at 6:27 PM, Karl Vollmer <vollmer at ampache.org> wrote:
>> Attached is a svn diff that should allow Amarok2 to authenticate to
>> 3.4.x and 3.5.x Ampache servers. The Ampache service now requires QCA2
>> due to the use of SHA256() Thanks a to nhnFreespirit for working his
>> cmake-fu on the QCA2 cmake stuff.
>>
>> This patch works by attempting to get a results set from
>> /xml.server.php?action=ping which is only valid on Ampache >=3.5.0. If
>> no valid response is returned the version is set to 10000, otherwise
>> the version is defined by the XML response. Using the version it
>> determines if it should use MD5() or SHA256().
>>
>> This patch does not address the changes / new features in the 3.5.x
>> API however 3.4.x calls will work against 3.5.x so it should continue
>> to work for the foreseeable future... Until I break the Ampache end.
>
> Hi,
>
> Various comments on the patch:
>
>> +    versionString.replace(QString("<server>"), m_server);
>
> I'm not sure if you were just following the style of the rest of the
> file, but there should be no need to wrap "<server>" in QString(), it
> happens implicitly.
>
> Also be sure to read HACKING/intro_and_style.txt, the spacing
> throughout this patch is a bit wonky
>
> *)  I'm not exactly sure why you pass the kjob to all the functions
> when m_xmlVersionJob points to the same place (as far as I can tell)
> My suggestion would be to eliminate the m_xmlVersionJob and just use
> the KJob passed in the emitted signal.
>
> *) I'm not positive, but I'm a little leery about your string version
> comparisons being proper, I'd keep m_version as an integer, and do
> m_version = element.text().toInt(); instead, so you're not comparing
> strings numerically.
>
> Other than that, It looks good to me... but I havn't tested it!
>
>>
>> -Karl
>>
>> _______________________________________________
>> Amarok-devel mailing list
>> Amarok-devel at kde.org
>> https://mail.kde.org/mailman/listinfo/amarok-devel
>>
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: amarok-ampache35-2.diff
Type: text/x-diff
Size: 8295 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/amarok-devel/attachments/20090218/ffeac895/attachment-0001.bin 


More information about the Amarok-devel mailing list