diff --git a/README.md b/README.md index d584b961cd..e44bab5bfe 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ ## News -Ampache6 is about to shake up the develop branch. Keep track using the [wiki](https://github.com/ampache/ampache/wiki/ampache6-details) +Ampache6 is [HERE!](https://github.com/ampache/ampache/releases/tag/6.0.0) ## Basics @@ -23,12 +23,12 @@ presents an already organised collection in a useful way. It assumes that you know best how to manage your files and are capable of choosing a suitable method for doing so. -* Check out [Ampache 5 for Admins](https://github.com/ampache/ampache/wiki/Ampache-Next-Changes) -* As well as [Ampache 5 for Users](https://github.com/ampache/ampache/wiki/Ampache-5-for-users) +* Check out [Ampache 6 for Admins](https://github.com/ampache/ampache/wiki/ampache6-details) +* As well as [Ampache 6 for Users](https://github.com/ampache/ampache/wiki/ampache6-for-users) ## Recommended Version -The recommended and most stable version is the current stable [release5 branch](https://github.com/ampache/ampache/archive/release5.tar.gz). +The recommended and most stable version is the current stable [release6 branch](https://github.com/ampache/ampache/archive/release6.tar.gz). You get the latest version with recent changes and fixes but maybe in an unstable state from our [develop branch](https://github.com/ampache/ampache/archive/develop.tar.gz). [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ampache/ampache/badges/quality-score.png?b=develop)](https://scrutinizer-ci.com/g/ampache/ampache/?branch=develop) @@ -56,7 +56,7 @@ Please see [the wiki](https://github.com/ampache/ampache/wiki/Installation) and * PHP 8.1 (Ampache 5.5.0 and higher) * PHP 8.2 (Ampache 6.0.0 and higher) -**NOTE** That php7.4 will not be released for Ampache6 but can still be used. +**NOTE** That php7.4 will not be supported for Ampache6 but can still be used. * PHP modules: * PDO diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 0f68bdf782..3de17082e8 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,27 @@ # CHANGELOG +## Ampache 6.0.1 + +### Fixed + +* Check for duplicate ports in stream URL's +* Songs and podcast_episodes with ABR being overwritten with VBR + +## API 6.0.1 + +### Changed + +* API6 XML + * get_similar: return song objects to match json + +### Fixed + +* API6 + * user_preference: returned array instead of object + * system_preference: returned array instead of object + * preference_create: returned array instead of object + * preference_edit: returned array instead of object + ## Ampache 6.0.0 **NOTE** For database update 600005; please consider using the CLI update command (`php bin/cli admin:updateDatabase -e`) diff --git a/src/Config/Init/InitializationHandlerConfig.php b/src/Config/Init/InitializationHandlerConfig.php index 345f580839..35680ac32a 100644 --- a/src/Config/Init/InitializationHandlerConfig.php +++ b/src/Config/Init/InitializationHandlerConfig.php @@ -32,7 +32,7 @@ final class InitializationHandlerConfig implements InitializationHandlerInterface { - private const VERSION = '6.0.0'; // AMPACHE_VERSION + private const VERSION = '6.0.1'; // AMPACHE_VERSION private const CONFIG_VERSION = '67'; private const STRUCTURE = 'public'; // Project release is using either the public html folder or squashed structure diff --git a/src/Module/Api/Api.php b/src/Module/Api/Api.php index 50bd8deebd..4409a6b4b4 100644 --- a/src/Module/Api/Api.php +++ b/src/Module/Api/Api.php @@ -172,12 +172,12 @@ class Api /** * @var string $version */ - public static $version = '6.0.0'; // AMPACHE_VERSION + public static $version = '6.0.1'; // AMPACHE_VERSION /** * @var string $version_numeric */ - public static $version_numeric = '600000'; // AMPACHE_VERSION + public static $version_numeric = '601000'; // AMPACHE_VERSION /** * @var Browse $browse diff --git a/src/Module/Api/Method/GetSimilarMethod.php b/src/Module/Api/Method/GetSimilarMethod.php index 2fd76feec6..7371c7d5d3 100644 --- a/src/Module/Api/Method/GetSimilarMethod.php +++ b/src/Module/Api/Method/GetSimilarMethod.php @@ -90,12 +90,24 @@ public static function get_similar(array $input, User $user): bool case 'json': Json_Data::set_offset($input['offset'] ?? 0); Json_Data::set_limit($input['limit'] ?? 0); - echo Json_Data::indexes($results, $type, $user); + switch ($type) { + case 'artist': + echo Json_Data::artists($results, array(), $user); + break; + case 'song': + echo Json_Data::songs($results, $user); + } break; default: Xml_Data::set_offset($input['offset'] ?? 0); Xml_Data::set_limit($input['limit'] ?? 0); - echo Xml_Data::indexes($results, $type, $user); + switch ($type) { + case 'artist': + echo Xml_Data::artists($results, array(), $user); + break; + case 'song': + echo Xml_Data::songs($results, $user); + } } return true; diff --git a/src/Module/Api/Method/PreferenceCreateMethod.php b/src/Module/Api/Method/PreferenceCreateMethod.php index f360db9c09..e0153c36c1 100644 --- a/src/Module/Api/Method/PreferenceCreateMethod.php +++ b/src/Module/Api/Method/PreferenceCreateMethod.php @@ -101,7 +101,7 @@ public static function preference_create(array $input, User $user): bool } switch ($input['api_format']) { case 'json': - echo json_encode($results, JSON_PRETTY_PRINT); + echo json_encode($results[0], JSON_PRETTY_PRINT); break; default: echo Xml_Data::object_array($results, 'preference'); diff --git a/src/Module/Api/Method/PreferenceEditMethod.php b/src/Module/Api/Method/PreferenceEditMethod.php index ee51431bac..98d21d804e 100644 --- a/src/Module/Api/Method/PreferenceEditMethod.php +++ b/src/Module/Api/Method/PreferenceEditMethod.php @@ -78,14 +78,13 @@ public static function preference_edit(array $input, User $user): bool return false; } - $preference = Preference::get($pref_name, $user->id); - $output_array = array('preference' => $preference); + $results = Preference::get($pref_name, $user->id); switch ($input['api_format']) { case 'json': - echo json_encode($output_array, JSON_PRETTY_PRINT); + echo json_encode($results[0], JSON_PRETTY_PRINT); break; default: - echo Xml_Data::object_array($output_array['preference'], 'preference'); + echo Xml_Data::object_array($results, 'preference'); } return true; diff --git a/src/Module/Api/Method/SystemPreferenceMethod.php b/src/Module/Api/Method/SystemPreferenceMethod.php index 43d5beff1f..96a1f5d590 100644 --- a/src/Module/Api/Method/SystemPreferenceMethod.php +++ b/src/Module/Api/Method/SystemPreferenceMethod.php @@ -66,7 +66,7 @@ public static function system_preference(array $input, User $user): bool } switch ($input['api_format']) { case 'json': - echo json_encode($results, JSON_PRETTY_PRINT); + echo json_encode($results[0], JSON_PRETTY_PRINT); break; default: echo Xml_Data::object_array($results, 'preference'); diff --git a/src/Module/Api/Method/UserPreferenceMethod.php b/src/Module/Api/Method/UserPreferenceMethod.php index 852a7f6d2e..2fa3df1cd9 100644 --- a/src/Module/Api/Method/UserPreferenceMethod.php +++ b/src/Module/Api/Method/UserPreferenceMethod.php @@ -64,7 +64,7 @@ public static function user_preference(array $input, User $user): bool } switch ($input['api_format']) { case 'json': - echo json_encode($results, JSON_PRETTY_PRINT); + echo json_encode($results[0], JSON_PRETTY_PRINT); break; default: echo Xml_Data::object_array($results, 'preference'); diff --git a/src/Module/Playback/Stream.php b/src/Module/Playback/Stream.php index 482970138b..2a23b4ab36 100644 --- a/src/Module/Playback/Stream.php +++ b/src/Module/Playback/Stream.php @@ -761,6 +761,10 @@ public static function get_base_url($local = false, $streamToken = null) $web_path = str_replace(AmpConfig::get('http_host'), AmpConfig::get('http_host') . ':' . $http_port, (string)$web_path); } } + // check for dupe ports + if (substr_count($web_path, ':') === 2) { + $web_path = preg_replace('/(^.*?):([0-9]+)(:.*)?$/', '$1$3', $web_path); + } return $web_path . $base_url; } // get_base_url diff --git a/src/Repository/Model/Catalog.php b/src/Repository/Model/Catalog.php index f779eedca3..74ebbfc736 100644 --- a/src/Repository/Model/Catalog.php +++ b/src/Repository/Model/Catalog.php @@ -2536,7 +2536,7 @@ public static function update_song_from_tags($results, Song $song) $new_song->title = self::check_length(self::check_title($results['title'], $new_song->file)); $new_song->bitrate = $results['bitrate']; $new_song->rate = $results['rate']; - $new_song->mode = ($results['mode'] == 'cbr') ? 'cbr' : 'vbr'; + $new_song->mode = (in_array($results['mode'], ['vbr', 'cbr', 'abr'])) ? $results['mode'] : 'vbr'; $new_song->channels = $results['channels']; $new_song->size = $results['size']; $new_song->time = (strlen((string)$results['time']) > 5) @@ -2973,7 +2973,7 @@ public static function update_podcast_episode_from_tags($results, Podcast_Episod $podcast_episode->time = $results['time']; $podcast_episode->bitrate = $results['bitrate']; $podcast_episode->rate = $results['rate']; - $podcast_episode->mode = ($results['mode'] == 'cbr') ? 'cbr' : 'vbr'; + $podcast_episode->mode = (in_array($results['mode'], ['vbr', 'cbr', 'abr'])) ? $results['mode'] : 'vbr'; $podcast_episode->channels = $results['channels']; $array = array();