Skip to content

Commit

Permalink
Merge branch 'feature/1035_relay_ext_streams'
Browse files Browse the repository at this point in the history
  • Loading branch information
paulijar committed Dec 28, 2024
2 parents bc1f015 + 133474b commit 8cd5d82
Show file tree
Hide file tree
Showing 28 changed files with 1,163 additions and 845 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
* OpenSubsonic extension [`apiKeyAuthentication`](https://opensubsonic.netlify.app/docs/extensions/apikeyauth/), including support for arg `apiKey` and the new method `tokenInfo`

### Changed
- Renamed config.php key `music.allowed_radio_src` as `music.allowed_stream_src`. Its default value is now an empty array `[]`.
- Internet radio and podcast streams are now relayed via the user's cloud instance by default. To opt out, set the config.php keys `music.relay_radio_stream` and `music.relay_podcast_stream` as `false` and add required sources to `music.allowed_stream_src`.
[#1035](https://github.com/owncloud/music/issues/1035)
- Documentation of the admin configuration options moved from the Settings view to the [Wiki page](https://github.com/owncloud/music/wiki/Admin-settings)
- Troubleshooting for Internet radio moved to the [Wiki page](https://github.com/owncloud/music/wiki/Internet-radio-trouble-shooting)
- Allow translating all the strings in the embedded Files player and the new Dashboard widget. Provide Finnish translations for these.
- Ampache API:
* Action `get_indexes` supports also `type=song_artist`
Expand Down
4 changes: 4 additions & 0 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
['name' => 'coverApi#cachedCover', 'url' => '/api/cover/{hash}', 'verb' => 'GET'],
['name' => 'coverApi#artistCover', 'url' => '/api/artist/{artistId}/cover', 'verb' => 'GET'],
['name' => 'coverApi#albumCover', 'url' => '/api/album/{albumId}/cover', 'verb' => 'GET'],
['name' => 'coverApi#podcastCover', 'url' => '/api/podcasts/{channelId}/cover', 'verb' => 'GET'],

// Shiva API https://shiva.readthedocs.io/en/latest/index.html
['name' => 'shivaApi#artists', 'url' => '/api/artists', 'verb' => 'GET'],
Expand Down Expand Up @@ -88,20 +89,23 @@
['name' => 'radioApi#importFromFile', 'url' => '/api/radio/import', 'verb' => 'POST'],
['name' => 'radioApi#resetAll', 'url' => '/api/radio/reset', 'verb' => 'POST'],
['name' => 'radioApi#resolveStreamUrl', 'url' => '/api/radio/streamurl', 'verb' => 'GET'],
['name' => 'radioApi#streamFromUrl', 'url' => '/api/radio/stream', 'verb' => 'GET'],
['name' => 'radioApi#hlsManifest', 'url' => '/api/radio/hls/manifest', 'verb' => 'GET'],
['name' => 'radioApi#hlsSegment', 'url' => '/api/radio/hls/segment', 'verb' => 'GET'],
['name' => 'radioApi#get', 'url' => '/api/radio/{id}', 'verb' => 'GET'],
['name' => 'radioApi#delete', 'url' => '/api/radio/{id}', 'verb' => 'DELETE'],
['name' => 'radioApi#update', 'url' => '/api/radio/{id}', 'verb' => 'PUT'],
['name' => 'radioApi#getChannelInfo', 'url' => '/api/radio/{id}/info', 'verb' => 'GET'],
['name' => 'radioApi#stationStreamUrl', 'url' => '/api/radio/{id}/streamurl', 'verb' => 'GET'],
['name' => 'radioApi#stationStream', 'url' => '/api/radio/{id}/stream', 'verb' => 'GET'],

// podcast API
['name' => 'podcastApi#getAll', 'url' => '/api/podcasts', 'verb' => 'GET'],
['name' => 'podcastApi#subscribe', 'url' => '/api/podcasts', 'verb' => 'POST'],
['name' => 'podcastApi#get', 'url' => '/api/podcasts/{id}', 'verb' => 'GET'],
['name' => 'podcastApi#channelDetails', 'url' => '/api/podcasts/{id}/details', 'verb' => 'GET'],
['name' => 'podcastApi#episodeDetails', 'url' => '/api/podcasts/episodes/{id}/details', 'verb' => 'GET'],
['name' => 'podcastApi#episodeStream', 'url' => '/api/podcasts/episodes/{id}/stream', 'verb' => 'GET'],
['name' => 'podcastApi#unsubscribe', 'url' => '/api/podcasts/{id}', 'verb' => 'DELETE'],
['name' => 'podcastApi#updateChannel', 'url' => '/api/podcasts/{id}/update', 'verb' => 'POST'],
['name' => 'podcastApi#resetAll', 'url' => '/api/podcasts/reset', 'verb' => 'POST'],
Expand Down
3 changes: 2 additions & 1 deletion css/app/music-sidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@
}

#app-sidebar .tutorial h2,
#app-sidebar .tutorial li {
#app-sidebar .tutorial li,
#app-sidebar .tutorial p {
margin-bottom: 10px;
}

Expand Down
4 changes: 2 additions & 2 deletions js/app/l10n/translations.js

Large diffs are not rendered by default.

16 changes: 6 additions & 10 deletions js/embedded/embeddedplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ OCA.Music.EmbeddedPlayer = function() {
});
}

function resolveExtUrl(url, callback) {
$.get(OC.generateUrl('apps/music/api/radio/streamurl'), {url: url}, callback);
function resolveExtUrl(url, token, callback) {
$.get(OC.generateUrl('apps/music/api/radio/streamurl'), {url: url, token: token}, callback);
}

function changePlayingUrl(playCallback) {
Expand Down Expand Up @@ -512,21 +512,17 @@ OCA.Music.EmbeddedPlayer = function() {
});
};

this.playExtUrl = function(url, caption, shareToken = null) {
this.playExtUrl = function(url, urlToken, caption) {
currentFileId = null;
updateMetadata({
title: caption,
artist: url,
cover: radioIconPath
});
changePlayingUrl(function() {
resolveExtUrl(url, function(resolved) {
if (shareToken && resolved.hls) {
OC.Notification.showTemporary(t('music', 'Stream type not supported on shared file'));
} else {
player.fromExtUrl(resolved.url, resolved.hls);
play();
}
resolveExtUrl(url, urlToken, function(resolved) {
player.fromExtUrl(resolved.url, resolved.hls);
play();
});
});
};
Expand Down
2 changes: 1 addition & 1 deletion js/embedded/folderview.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ OCA.Music.FolderView = class {
this.#currentFile = file;
}
if (file.external) {
this.#player.playExtUrl(file.url, file.caption, this.#shareToken);
this.#player.playExtUrl(file.url, file.token, file.caption);
} else {
this.#player.playFile(
this.#urlForFile(file),
Expand Down
Loading

0 comments on commit 8cd5d82

Please sign in to comment.