Skip to content

Commit

Permalink
local (relative) playlists in M3U files #325
Browse files Browse the repository at this point in the history
  • Loading branch information
Rello committed Jan 24, 2019
1 parent 7f17214 commit d066476
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
All notable changes to the Audio Player project will be documented in this file.

## 2.6.0 - 2019-01-xx
### Added
- local (relative) playlists in M3U files [#325](https://github.com/rello/audioplayer/issues/325)

## 2.5.2 - 2019-01-22
### Fixed
- player not loaded on shared folder [#371](https://github.com/rello/audioplayer/issues/371) @[Ark74](https://github.com/Ark74)
Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- [SONOS player](https://github.com/rello/audioplayer/wiki/SONOS) integration
See [README](https://github.com/rello/audioplayer/blob/master/README.md) file for all supported MIME types and limitations.]]></description>
<version>2.5.2</version>
<version>2.6.0-rc1</version>
<licence>agpl</licence>
<author>Marcel Scherello</author>
<namespace>audioplayer</namespace>
Expand Down
24 changes: 23 additions & 1 deletion lib/Controller/CategoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,8 @@ private function StreamParser($fileId)
$title = null;
$userView = $this->rootFolder->getUserFolder($this->userId);
//\OCP\Util::writeLog('audioplayer',substr($categoryId, 1), \OCP\Util::DEBUG);
$streamfile = $userView->getById($fileId);

$streamfile = $userView->getById($fileId);
$file_type = $streamfile[0]->getMimetype();
$file_content = $streamfile[0]->getContent();

Expand Down Expand Up @@ -485,7 +485,29 @@ private function StreamParser($fileId)
$row['lin'] = $matches[0][0];
$row['fav'] = 'f';
if ($title) $row['cl1'] = $title;
$title = null;
$aTracks[] = $row;
} elseif (preg_match('/^[^*?"<>|:#]*$/',$line)) {
$path = explode('/', $streamfile[0]->getInternalPath());
array_shift($path);
array_pop($path);
array_push($path, $line);
$path = implode('/', $path);
$x++;
$row = array();
$row['id'] = $fileId . $x;
$row['fid'] = $fileId . $x;
$row['cl1'] = $line;
$row['cl2'] = '';
$row['cl3'] = '';
$row['len'] = '';
$row['mim'] = 'audio/mpeg';
$row['cid'] = '';
$row['lin'] = $path;
$row['fav'] = 'f';
if ($title) $row['cl1'] = $title;
$aTracks[] = $row;
$title = null;
}
}
}
Expand Down

0 comments on commit d066476

Please sign in to comment.