Skip to content

Commit

Permalink
Fixes title not displaying if only author present w/ YTTL
Browse files Browse the repository at this point in the history
Fixes remote video title not displaying if auto play is enabled (w/o YTTL)
Fixes #9 - Wrong title display in remote w/o YTTL
  • Loading branch information
JLChnToZ committed Oct 14, 2023
1 parent 0f043af commit 0b8662d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Packages/idv.jlchntoz.vvmw/Runtime/VVMW/FrontendHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ void Start() {
RequestSync();
UpdateState();
}
}
} else
localPlayListIndex = 0; // Wait for deserialization
}

public void _AutoPlay() {
Expand Down Expand Up @@ -292,7 +293,7 @@ public override void OnDeserialization() {
}
localFlags = flags;
if (playListIndex > 0 && (localPlayListIndex != playListIndex || localPlayingIndex != playingIndex))
core.SetTitle(playListEntryTitles[localPlayingIndex], playListTitles[playListIndex - 1]);
core.SetTitle(playListEntryTitles[playingIndex], playListTitles[playListIndex - 1]);
localPlayListIndex = playListIndex;
localPlayingIndex = playingIndex;
core.Loop = RepeatOne;
Expand Down
8 changes: 4 additions & 4 deletions Packages/idv.jlchntoz.vvmw/Runtime/VVMW/UIHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -657,8 +657,8 @@ void UpdateProgressOnce() {
if (durationText != null)
durationText.text = languageManager.GetLocale("TimeIdleFormat");
if (statusText != null) {
if (!string.IsNullOrEmpty(core.title))
statusText.text = string.Format(languageManager.GetLocale("StreamingWithTitle"), core.title, core.author, core.description, core.viewCount);
if (!string.IsNullOrEmpty(core.title) || !string.IsNullOrEmpty(core.author))
statusText.text = string.Format(languageManager.GetLocale("StreamingWithTitle"), core.title, core.author);
else
statusText.text = languageManager.GetLocale("Streaming");
}
Expand All @@ -680,8 +680,8 @@ void UpdateProgressOnce() {
if (statusText != null) {
if (core.IsPaused)
statusText.text = string.Format(languageManager.GetLocale("Paused"), time, durationTS);
else if (!string.IsNullOrEmpty(core.title))
statusText.text = string.Format(languageManager.GetLocale("PlayingWithTitle"), time, durationTS, core.title, core.author, core.description, core.viewCount);
else if (!string.IsNullOrEmpty(core.title) || !string.IsNullOrEmpty(core.author))
statusText.text = string.Format(languageManager.GetLocale("PlayingWithTitle"), time, durationTS, core.title, core.author);
else
statusText.text = string.Format(languageManager.GetLocale("Playing"), time, durationTS);
}
Expand Down

0 comments on commit 0b8662d

Please sign in to comment.