When include is not passed to `artists` or `albums` API function, it
will default to `NULL`. Make it default to `[]` to avoid a message in
the error log.
Return total count of items in API actions which make use of `filter`
and `offset` parameters. This way, the user of the API can know easily
if he should query for more items or not, and implement a pagination
mechanism on his side.
Fix coding guidelines incoherences. Code should match PSR1/2 now, and
php-cs is set to check it on each commit.
Also fixed the Git hook to take into account only added, modified,
copied and renamed files (preventing errors when trying to check deleted
files).
Closes#1260.
Includes are specified by the `include[]` array `GET` parameter.
Supported includes as of now are:
* For `artists` and `artist` actions, you can include `albums` and/or `songs`.
* For `albums` action, you can include `songs`.
* Provide artists art in the `artists` method.
* Add `name` as an alias for `title` attribute for `songs` and stuff.
* Add a `.htaccess` file to enable CORS headers.
Closes#1292.
DSub not playing music over Subsonic API
The return value from `curl_exec` call in `Subsonic_API::follow_stream`
was not checked, leading to silent error when an incorrect URL was
provided (typically when `local_web_path` was not correctly set).
Also, the use of curl in `follow_stream` function was quite
counter-intuitive and unclear, I added a comment about it to help others
digging into the code.
Generate `sceret_key` on Ampache installation
Generate a `secret_key` on Ampache installation and put it in the
generated config. This removes the need to do it manually, and the
secret key is ensured to be crypto safe.
Also move the `web_path` configuration setting under a "Various"
fieldset, as it had nothing to do with database settings.
Also added a comment about a missing `break` statement, which was on
purpose, but one could think it was a mistake at first sight.
Closes#1248.
Homogeneize `username` field length in SQL database.
Set the `VARCHAR` field used for `username` to have a maximum size of
255, which was the highest value used across the tables. This should fix
some errors with MySQL strict mode (and potentially unnoticed previous
errors).
Also edited the `fullname` field length to match the `username` field
length.
Closes#1214.
XML API version is now assumed to be the latest available if not
specified as a parameter. Also fix the issue that an empty XML document
was issued when the version was not specified.
Closes issue #1247.
* Fix php-cs according to https://github.com/ampache/ampache/issues/1251
to fix travis build. Use composer to force the 1.* version to be used.
* Add `encoding` fixer.
* Use the same set of fixers in Git commit hook and test script.
* Update hooks and scripts.
* Fix a braces issue detected by php-cs.
Closes issue #1251.
This commit introduces a `nT_` function to handle pluralization in
localizations, and avoid the need to call ngettext, which was resulting
in errors if PHP Gettext module was not available (and this was not
enforced by Ampache).
Any occurrence of `ngettext` has been replaced by this `nT_` call.
Also removed the useless keywords in the `gather-messages.sh` script,
and added the newly introduced `nT_` keyword.
Closes issue #123.
Image size checking did not handle empty values (e.g. max height/width was not set in config).
As result, any image would be "not in range" even when the user would expect that it would.
To get better information while debugging the error message has also be expanded to include
the configured/assumed min/max value and the current height/width which was checked.
Second fix in this commit addresses broken google image search.
Google has changed the image search page some time ago. This causes the old code to get an error 404
when trying to retrive images.
In addition to the broken URL, the way to parse the HTML result was also broken.
Google now sends some sort of JSON and HTML mix string.
Currently some simple regex will try to find all image urls, maybe someone will find a better solution.
add support for 'state' and 'city' in external auths
add support for an 'auto_update' of the users date from external auths
add support for 'state' and 'city' in LDAP