Display play progress in human-readable format.

This commit is contained in:
Abdulmhsen B. A. A
2024-05-11 20:35:31 +03:00
parent 8b7a6aa86a
commit 13559cb6ec
2 changed files with 2 additions and 2 deletions

View File

@@ -365,7 +365,7 @@ final class Index
} }
$item['full_title'] = $entity->getName(); $item['full_title'] = $entity->getName();
$item['progress'] = $entity->hasPlayProgress() ? $entity->getPlayProgress() : null; $item['progress'] = $entity->hasPlayProgress() ? formatDuration($entity->getPlayProgress()) : null;
$item['event'] = ag($entity->getExtra($entity->via), iState::COLUMN_EXTRA_EVENT, null); $item['event'] = ag($entity->getExtra($entity->via), iState::COLUMN_EXTRA_EVENT, null);
$item = [ $item = [

View File

@@ -475,7 +475,7 @@ final class ListCommand extends Command
'via' => $entity->via ?? '??', 'via' => $entity->via ?? '??',
'date' => makeDate($entity->updated)->format('Y-m-d H:i:s T'), 'date' => makeDate($entity->updated)->format('Y-m-d H:i:s T'),
'played' => $entity->isWatched() ? 'Yes' : 'No', 'played' => $entity->isWatched() ? 'Yes' : 'No',
'progress' => $entity->hasPlayProgress() ? $entity->getPlayProgress() : 'None', 'progress' => $entity->hasPlayProgress() ? formatDuration($entity->getPlayProgress()) : 'None',
'event' => ag($entity->extra[$entity->via] ?? [], iState::COLUMN_EXTRA_EVENT, '-'), 'event' => ag($entity->extra[$entity->via] ?? [], iState::COLUMN_EXTRA_EVENT, '-'),
]; ];
} }