Skip to content

5.0.1

Compare
Choose a tag to compare
@lachlan-00 lachlan-00 released this 24 Aug 01:38
· 183 commits to master since this release
7e08ed1

Quick fire bug fixes

Bug fixes from initial release found when updating.

  • If you ping a session and it's successful, set the session without requiring a handshake
  • All docs and examples are updated and fully functional
  • set_key would overwrite your session instead of setting AMPACHE_KEY
  • artists was missing the album_artist parameter
  • docs/MANUAL.md added to the repo with a breakdown of the class structure

Ready for Ampache 5

A python3 library for interaction with your Ampache 5.x.x server using the XML & JSON API

  • Additional methods in this release match up with the current develop branch (soon to be Ampache 5.0.0)
  • Password auth is available instead of just API Keys
  • The structural changes to the lib do not support Ampache 4 and do not support old versions of the lib.
  • Version 4 will be maintained along with Ampache 4 until the end of PHP 7.4 support.

Changes in this release

There has been a pretty significant change in the library between Ampache 4 and Ampache 5.

For anyone wanting to stay on v4 the branch has been separated into it's own branch.

Once you connect with your passphrase or api key the url and auth token are stored for most methods allowing you to call methods without them.

Below is a quick example of the changes.

    import ampache
    import time

    # load up the lib
    ampacheConnection = ampache.API()

    # if using password auth use encrypt_password
    mytime = int(time.time())
    passphrase = ampacheConnection.encrypt_password('mypassword', mytime)
    auth = ampacheConnection.handshake('https://music.com.au', passphrase, 'my username', mytime)

    # if using an API key auth keep using encrypt_string
    passphrase = ampacheConnection.encrypt_string('my apikey', 'my username')
    auth = ampacheConnection.handshake('https://music.com.au', passphrase)

    # now you can call methods without having to keep putting in the url and userkey
    ampacheConnection.label(1677)
    
    # ping has always allowed empty calls so you have to ping with a url and session still
    ampacheConnection.ping('https://music.com.au', auth)