1
0
mirror of synced 2025-02-17 19:09:25 +01:00

Do not use SUBTITLE if localized title is used (#323)

+ a bonus edit : Allowing SUBTITLE to pick up an input w/o -- or ++ prefix
This commit is contained in:
DragonRatTiger 2022-11-07 03:51:43 -05:00 committed by GitHub
parent 0ff2764a67
commit d8cfd7c06c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1316,6 +1316,7 @@ namespace TJAPlayer3
private readonly string langTITLE = "TITLE" + CLangManager.fetchLang().ToUpper();
private readonly string langSUBTITLE = "SUBTITLE" + CLangManager.fetchLang().ToUpper();
private bool titleIsLocalized = false;
private int nスクロール方向 = 0;
//2015.09.18 kairera0467
@ -4997,16 +4998,14 @@ namespace TJAPlayer3
}
//パラメータを分別、そこから割り当てていきます。
if (strCommandName.Equals("TITLE"))
if (strCommandName.Equals("TITLE") && !titleIsLocalized) // Do not grab default TITLE if localized title is used first.
{
//this.TITLE = strCommandParam;
var subTitle = "";
for (int i = 0; i < strArray.Length; i++)
{
subTitle += strArray[i];
}
this.TITLE = subTitle.Substring(5);
//tbTitle.Text = strCommandParam;
}
else if (strCommandName.Equals(langTITLE))
{
@ -5016,12 +5015,13 @@ namespace TJAPlayer3
subTitle += strArray[i];
}
this.TITLE = subTitle.Substring(7);
this.titleIsLocalized = true;
this.SUBTITLE = ""; // Wipe default SUBTITLE if picked up before localized subtitle.
}
if (strCommandName.Equals("SUBTITLE"))
if (strCommandName.Equals("SUBTITLE") && !titleIsLocalized) // Do not grab default SUBTITLE if localized title is used first. Avoids localization conflicts. (i.e. English title w/ default Japanese subtitle)
{
if (strCommandParam.StartsWith("--"))
{
//this.SUBTITLE = strCommandParam.Remove( 0, 2 );
var subTitle = "";
for (int i = 0; i < strArray.Length; i++)
{
@ -5031,8 +5031,6 @@ namespace TJAPlayer3
}
else if (strCommandParam.StartsWith("++"))
{
// //this.TITLE += strCommandParam.Remove( 0, 2 ); //このままだと選曲画面の表示がうまくいかない。
//this.SUBTITLE = strCommandParam.Remove( 0, 2 );
var subTitle = "";
for (int i = 0; i < strArray.Length; i++)
{
@ -5040,6 +5038,15 @@ namespace TJAPlayer3
}
this.SUBTITLE = subTitle.Substring(10);
}
else
{
var subTitle = "";
for (int i = 0; i < strArray.Length; i++)
{
subTitle += strArray[i];
}
this.SUBTITLE = subTitle.Substring(8);
}
}
else if (strCommandName.Equals(langSUBTITLE))
{