mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
fix(ui,music): handle deleted message replies and safe null duration during restore
- Fall back to channel send when replyingTo message was deleted (UNKNOWN_MESSAGE 404) - Safely handle null duration in dashboard convertVideo and player embed during session restore - Protect lastfm scrobbler and search mixins from null duration properties
This commit is contained in:
1 parent
7c5fb1e468
commit
a0d6f32ea8
8 files changed
+49
-12
No files matched your search
@@ -268,7 +268,7 @@ const PlayerEventsMixin = {
|
||||
const durationMs = (() => {
|
||||
const d = song.duration;
|
||||
if (!d) return null;
|
||||
if (typeof d === "object" && d.seconds) return d.seconds * 1000;
|
||||
if (typeof d === "object" && d?.seconds) return d.seconds * 1000;
|
||||
if (typeof d === "number") return d;
|
||||
return null;
|
||||
})();
|
||||
|
||||
@@ -69,7 +69,7 @@ const PlaybackMixin = {
|
||||
if (track?.info?.length) return track.info.length;
|
||||
if (track?.info?.duration != null) {
|
||||
if (typeof track.info.duration === "number") return track.info.duration;
|
||||
if (typeof track.info.duration === "object" && track.info.duration.seconds != null)
|
||||
if (typeof track.info.duration === "object" && track.info.duration?.seconds != null)
|
||||
return track.info.duration.seconds * 1000;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -306,7 +306,7 @@ const SearchMixin = {
|
||||
if (ms === 0 && info.duration != null) {
|
||||
if (typeof info.duration === "number") {
|
||||
ms = info.duration;
|
||||
} else if (typeof info.duration === "object" && info.duration.seconds != null) {
|
||||
} else if (typeof info.duration === "object" && info.duration?.seconds != null) {
|
||||
ms = info.duration.seconds * 1000;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user