mirror of
https://github.com/KRTirtho/spotube.git
synced 2026-08-06 04:09:51 +00:00
fix: use microseconds for YouTube track duration (#3021)
The metadata plugin sent the duration as inSeconds, but SpotubeAudioSourceMatchObject.duration is a Duration that gets read back as microseconds, so YouTube tracks showed 0:00 in the queue. Switch both callbacks to inMicroseconds, and fall back to 0 since the field can't be null and some videos don't report a duration.
This commit is contained in:
parent
69a310c78f
commit
a5f86fb969
@ -90,7 +90,7 @@ class MetadataPlugin {
|
|||||||
'id': video.id.value,
|
'id': video.id.value,
|
||||||
'title': video.title,
|
'title': video.title,
|
||||||
'author': video.author,
|
'author': video.author,
|
||||||
'duration': video.duration?.inSeconds,
|
'duration': video.duration?.inMicroseconds ?? 0,
|
||||||
'description': video.description,
|
'description': video.description,
|
||||||
'uploadDate': video.uploadDate?.toIso8601String(),
|
'uploadDate': video.uploadDate?.toIso8601String(),
|
||||||
'viewCount': video.engagement.viewCount,
|
'viewCount': video.engagement.viewCount,
|
||||||
@ -105,7 +105,7 @@ class MetadataPlugin {
|
|||||||
'id': video.id.value,
|
'id': video.id.value,
|
||||||
'title': video.title,
|
'title': video.title,
|
||||||
'author': video.author,
|
'author': video.author,
|
||||||
'duration': video.duration?.inSeconds,
|
'duration': video.duration?.inMicroseconds ?? 0,
|
||||||
'description': video.description,
|
'description': video.description,
|
||||||
'uploadDate': video.uploadDate?.toIso8601String(),
|
'uploadDate': video.uploadDate?.toIso8601String(),
|
||||||
'viewCount': video.engagement.viewCount,
|
'viewCount': video.engagement.viewCount,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user