diff --git a/js/embedded/main.js b/js/embedded/main.js index 8e0a641c9..6c4b1f6ab 100644 --- a/js/embedded/main.js +++ b/js/embedded/main.js @@ -54,7 +54,9 @@ function initEmbeddedPlayer() { register(); function urlForFile(file) { - let url = file.url ?? mFileList.getDownloadUrl(file.name, file.path); + let url = mFileList + ? mFileList.getDownloadUrl(file.name, file.path) + : OC.filePath('music', '', 'index.php') + '/api/file/' + file.id + '/download'; // Append request token unless this is a public share. This is actually unnecessary for most files // but needed when the file in question is played using our Aurora.js fallback player. @@ -289,7 +291,7 @@ function initEmbeddedPlayer() { */ exec: (file, view, dir) => { const adaptFile = (f) => { - return {id: f.fileid, name: f.basename, mimetype: f.mime, url: f.source, path: dir}; + return {id: f.fileid, name: f.basename, mimetype: f.mime, path: dir}; }; onActionCallback(adaptFile(file)); @@ -303,7 +305,7 @@ function initEmbeddedPlayer() { // this is how NC28 seems to do this (older NC versions, on the other hand, used the user-selected UI-language // as the locale for sorting although user-selected locale would have made even more sense). // This still leaves such a mismatch that the special characters may be sorted differently by localeCompare than - // what NC28 files does (it uses the 3rd party library natural-orderby for this). + // what NC28 Files does (it uses the 3rd party library natural-orderby for this). dirFiles.sort((a, b) => a.name.localeCompare(b.name, undefined, {numeric: true, sensitivity: 'base'})); mPlaylist = new OCA.Music.Playlist(dirFiles, mAudioMimes, mCurrentFile.id); diff --git a/lib/Controller/PlaylistApiController.php b/lib/Controller/PlaylistApiController.php index c796ad776..7f7d461e7 100644 --- a/lib/Controller/PlaylistApiController.php +++ b/lib/Controller/PlaylistApiController.php @@ -363,7 +363,6 @@ public function parseFile(int $fileId) { 'id' => $file->getId(), 'name' => $file->getName(), 'path' => $this->userFolder->getRelativePath($file->getParent()->getPath()), - 'url' => $this->urlGenerator->linkToRoute('music.api.download', ['fileId' => $file->getId()]), 'mimetype' => $file->getMimeType(), 'caption' => $fileInfo['caption'], 'in_library' => isset($libFileIds[$file->getId()]), diff --git a/lib/Controller/ShareController.php b/lib/Controller/ShareController.php index df402e3d5..155ae14c9 100644 --- a/lib/Controller/ShareController.php +++ b/lib/Controller/ShareController.php @@ -116,7 +116,6 @@ public function parsePlaylist(string $token, int $fileId) { 'id' => $file->getId(), 'name' => $file->getName(), 'path' => $sharedFolder->getRelativePath($file->getParent()->getPath()), - 'url' => 'TODO', 'mimetype' => $file->getMimeType(), 'caption' => $fileInfo['caption'], 'external' => false