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

Dan Meltzer parallelgrapefruit at gmail.com
Wed Feb 18 01:54:51 CET 2009


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
>
>


More information about the Amarok-devel mailing list