Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local (relative) playlists in M3U files #325

Closed
Koohiisan opened this issue Aug 6, 2018 · 22 comments
Closed

local (relative) playlists in M3U files #325

Koohiisan opened this issue Aug 6, 2018 · 22 comments
Assignees
Labels
Milestone

Comments

@Koohiisan
Copy link

Expected behavior

Clicking on an imported playlist file (m3u) should load the list of tracks to the player.

Actual behavior

Clicking on an imported playlist file loads the progress spinner and then briefly displays the track list headings before going back to "Add new tracks to playlist by drag and drop".

Steps to reproduce the behavior

  1. Scan a media location with an m3u file
  2. Go to the playlists panel
  3. Click on an m3u playlist

Possible solution (optional)

Additional information (optional)

I'm exporting these m3u files from MusicBee, and they seem to be normal, relative-path playlist files. Is there some specific requirement on format?

Server configuration

Operating system:
Windows 10

Web server:
Apache2

Database:
default

PHP version:
5.5

Nextcloud/ownCloud version: (see /status.php)
13.0.5

Updated from an older Nextcloud/ownCloud or fresh install:
updated from ownCloud

Audio Player version: (see /settings/apps)
2.3.1

Where did you install Audio Player from? NC App Store/oC Marketplace/GitHub
NC App Store

Are you using external storage? If yes, which one: local/smb/sftp/...
no

Are you using encryption? yes/no
no

Have you activated other multimedia apps? Music/Folder Player/...
no

Audio Player media folder: (see Settings) root/Music/...
/Music/

Client configuration

Operating system:
Windows 7, Windows 10

Browser:
Chrome

Logs

Nextcloud/ownCloud log

Nextcloud/ownCloud log (`/data/[nextcloud|owncloud].log`)
Insert your Nextcloud/ownCloud log here

Web server error log (optional)

Web server error log
Insert your web server log here

Browser log (optional)

Browser log
Insert your browser log here
@Rello
Copy link
Owner

Rello commented Aug 6, 2018

Hello,
can you send me the file for analysis to audioplayer (at) scherello (dot) de
then I will have a look

@Rello
Copy link
Owner

Rello commented Aug 18, 2018

Hello @Koohiisan
what do you mean by I'm exporting these m3u files from MusicBee, and they seem to be normal, relative-path playlist files. Is there some specific requirement on format?

Audioplayer can only support m3u with internet streams like web radios. you can not import local playlists but the relative path does not necessarily match the Nextcloud folder structrue

@Rello Rello added the needs info feedback from requester required label Aug 18, 2018
@Rello Rello self-assigned this Aug 18, 2018
@Koohiisan
Copy link
Author

@Rello, ah, that explains it then. MusicBee creates a local playlist file based on the filesystem in my Music folder on my PC, so for instance it may be similar to:

[playlist file]

/Music/song1.m4a
/Music/folderX/song2.m4a
/Music/song3.m4a

I sync the whole /Music folder to Nextcloud, and when I open the audioplayer in Nextcloud it shows me the playlist file in the left column. Clicking it shows a blank list of songs. If only streaming playlists are supported, then that explains the situation.

ncap

@Rello Rello removed the needs info feedback from requester required label Sep 8, 2018
@Rello
Copy link
Owner

Rello commented Sep 8, 2018

Hello,
yes - thats if for now.
I have it on the backlog list already because referential playlists are not that hard to implement.
But currently my unpaid time is limited and I have to focus und the features that I need for myself.

lets see :-)

@Rello Rello closed this as completed Sep 8, 2018
@r4sas
Copy link
Contributor

r4sas commented Jan 17, 2019

@Rello, is there any movement in this direction?
Tested m3u playlist with relative paths, got same "Add new tracks".

@Rello
Copy link
Owner

Rello commented Jan 22, 2019

Hello @r4sas ,
unfortunately still not much time to look at it.

In this section I would need to recognise, that there are local paths included; this is not the big part.
But for every relative path, it needs to be evaluated against file structure if the file really exists and derive the fileId from the filecache

not impossible, but I need some evenings for this.
I appreciate all your support for the translation of AP and will try to look at it, ok?

@r4sas
Copy link
Contributor

r4sas commented Jan 23, 2019

Okay ;)
I have tested m3u with relative paths, like:

#EXTM3U
#EXTINF:length,Author - Track
Folder1/track.flac

m3u file was placed in /music/ and Folder1 have path /music/Folder1 when I tested.

@Rello Rello reopened this Jan 23, 2019
@Rello
Copy link
Owner

Rello commented Jan 23, 2019

Hey @r4sas @Koohiisan

i am looking at the details.
m3u can also have absolute paths per definition like C://...
As I have not useful way to parse them, these need to be skipped completely. Does this match your expectation that we will only work with relative paths?

@r4sas
Copy link
Contributor

r4sas commented Jan 23, 2019

I think it must be listed in playlists, but in track list we must write message that playlists with absolute paths not supported.

@Rello
Copy link
Owner

Rello commented Jan 23, 2019

some good news in between.
need some more hardening the next days, but it looks promising...
screen shot 2019-01-23 at 22 26 24

@Rello Rello added this to the 2.6.0 milestone Jan 23, 2019
@Rello Rello changed the title Can't view or play M3U playlists at all M3U playlists for relative file paths Jan 23, 2019
@Koohiisan
Copy link
Author

Hey @r4sas @Koohiisan

i am looking at the details.
m3u can also have absolute paths per definition like C://...
As I have not useful way to parse them, these need to be skipped completely. Does this match your expectation that we will only work with relative paths?

Yes, this is my expectation as well, thanks!

@Rello Rello changed the title M3U playlists for relative file paths local (relative) playlists in M3U files Jan 24, 2019
@Rello Rello added testing and removed in progress labels Jan 24, 2019
@Rello
Copy link
Owner

Rello commented Jan 24, 2019

@r4sas @Koohiisan
do you have the possibility to test the 2.6.0-rc1 version here from Github in your environment?

@r4sas
Copy link
Contributor

r4sas commented Jan 24, 2019

@r4sas @Koohiisan
do you have the possibility to test the 2.6.0-rc1 version here from Github in your environment?

I have tested, all seems work as needed.

For future: can be ID3 tags loaded from files provided in playlist for fillment all track information?
image
How it look when played from folder category:
image

I can reference that request in new issue.

@Rello
Copy link
Owner

Rello commented Jan 24, 2019

I know. this is because I am doing a "stupid" lookup of the file path. There is no validation of the file or even a check it if is existing at all.

there are two possibilities:

  • derive the internal file-id from the provided path. then use this to read the information out of the audio player database
  • extract the file content on the fly and extract all ID3 information at every playlist opening

first way would be the best for performance.
Prerequisite is, that the file is indexed in AP for this. But as a successful index is also required to show the m3u, this should be taken for granted.

second option would be a performance pain especially for large indexes and external storage.

Let me check option 1 and come back...

@r4sas
Copy link
Contributor

r4sas commented Jan 24, 2019

Yes, I already started research in same way as your.
Gain m3u file path, split name and then do fetch fileid from filecache table with track full path 😆

@Rello
Copy link
Owner

Rello commented Jan 26, 2019

first version is online. ID3 are now taken from the AP-Database

@Rello
Copy link
Owner

Rello commented Jan 26, 2019

@r4sas any chance to give the current git-repo another try in your setup?

Gain m3u file path, split name and then do fetch fileid from filecache table with track full path

correct. what you mean i this: $fileId = $this->rootFolder->getUserFolder($this->userId)->get($path)->getId();

@r4sas
Copy link
Contributor

r4sas commented Jan 27, 2019

@Rello I see that track name taken from playlist, not ID3. Also at the end of playlist appears record with null values.
image

@r4sas
Copy link
Contributor

r4sas commented Jan 27, 2019

Last changes also broke work with m4a files.
They looks like started loading from server when choosed in playlist, and after few seconds marked as unaccessible. At same time flac work as usual.

And if file or path have plus symbol in name, that track will be inaccessible because looks like one of functions removes '+' from path.
In nextcloud.log I see that:

{"reqId":"9MtAKwPyNkm65nl6tmxe","level":3,"time":"2019-01-27T04:51:26+00:00","remoteAddr":"<ip>","user":"r4sas","app":"PHP","method":"GET","url":"\/apps\/audioplayer\/getaudiostream?file=music\/muse\/The%20Resistance\/04%20-%20United%20States%20of%20Eurasia%20(+Collateral%20Damage).m4a","message":"fopen(\/home\/www\/<domain>\/data\/r4sas\/files\/music\/muse\/The Resistance\/04 - United States of Eurasia ( Collateral Damage).m4a): failed to open stream: No such file or directory at \/home\/www\/<domain>\/public_html\/lib\/private\/Files\/Storage\/Local.php#284","userAgent":"<useragent>","version":"15.0.2.0"}

Original filename contain +:
04 - United States of Eurasia (+Collateral Damage).m4a

@Rello
Copy link
Owner

Rello commented Jan 27, 2019

@r4sas can you contact me via audioplayer(at)scherello.de ?
would be easier.

Rello added a commit that referenced this issue Jan 27, 2019
@Rello
Copy link
Owner

Rello commented Jan 27, 2019

ok, I found it.

  • I added an error handling in case of file in the playlist is not available in the cloud
  • I added proper escaping of special characters

@Rello Rello removed the testing label Jan 31, 2019
@Rello Rello closed this as completed Jan 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants