Skip to content

Commit

Permalink
Merge pull request #3585 from ampache/patch6
Browse files Browse the repository at this point in the history
6.0.1
  • Loading branch information
lachlan-00 committed Aug 29, 2023
2 parents 400a762 + 26add85 commit 3a4db55
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 19 deletions.
10 changes: 5 additions & 5 deletions README.md
Expand Up @@ -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

Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
22 changes: 22 additions & 0 deletions 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`)
Expand Down
2 changes: 1 addition & 1 deletion src/Config/Init/InitializationHandlerConfig.php
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/Module/Api/Api.php
Expand Up @@ -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
Expand Down
16 changes: 14 additions & 2 deletions src/Module/Api/Method/GetSimilarMethod.php
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Module/Api/Method/PreferenceCreateMethod.php
Expand Up @@ -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');
Expand Down
7 changes: 3 additions & 4 deletions src/Module/Api/Method/PreferenceEditMethod.php
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Module/Api/Method/SystemPreferenceMethod.php
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion src/Module/Api/Method/UserPreferenceMethod.php
Expand Up @@ -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');
Expand Down
4 changes: 4 additions & 0 deletions src/Module/Playback/Stream.php
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Repository/Model/Catalog.php
Expand Up @@ -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)
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 3a4db55

Please sign in to comment.