Skip to content

Commit

Permalink
fix duration display on playlist document item
Browse files Browse the repository at this point in the history
  • Loading branch information
brookgagnon committed Nov 13, 2024
1 parent 4225dfb commit 725b58f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.3.3-20241024
5.3.3-20241113
4 changes: 2 additions & 2 deletions controllers/playlists.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,9 @@ public function save()
// track properties
$properties = [];

// image properties
// image properties (also applies to documents)
$media = $this->models->media('get_by_id', ['id' => $data['item_id']]);
if ($media && $media['type'] == 'image') {
if ($media && ($media['type'] == 'image' || $media['type'] == 'document')) {
$properties['duration'] = (int) $item['duration'];
if ($properties['duration'] <= 0) {
$properties['duration'] = 15;
Expand Down
2 changes: 1 addition & 1 deletion models/playlists_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function get_items($id)
$item['type'] = $item['media_type'];
}

if ($item['type'] == 'image') {
if ($item['type'] == 'image' || $item['type'] == 'document') {
$item['duration'] = $item['properties']['duration'];
}

Expand Down

0 comments on commit 725b58f

Please sign in to comment.