1
0
mirror of synced 2024-11-24 07:30:21 +01:00

Transfer existing box.def to downloaded song subfolders if existing

This commit is contained in:
0aubsq 2022-05-25 04:01:46 +02:00
parent 1f7dea5f08
commit 2f94599b96

View File

@ -557,7 +557,8 @@ namespace TJAPlayer3
C曲リストード downloadBox = null;
for (int i = 0; i < TJAPlayer3.Songs管理.list曲ルート.Count; i++)
{
if (TJAPlayer3.Songs管理.list曲ルート[i].strジャンル == "Download")
if (TJAPlayer3.Songs管理.list曲ルート[i].strジャンル == "Download"
&& TJAPlayer3.Songs管理.list曲ルート[i].eード種別 == C曲リストード.Eード種別.BOX)
downloadBox = TJAPlayer3.Songs管理.list曲ルート[i];
}
@ -572,23 +573,46 @@ namespace TJAPlayer3
// Create Genre sub-folder if does not exist
Directory.CreateDirectory(genredPath);
// Generate box.def
// Search a corresponding box-def if exists
C曲リストード correspondingBox = null;
for (int i = 0; i < TJAPlayer3.Songs管理.list曲ルート.Count; i++)
{
if (TJAPlayer3.Songs管理.list曲ルート[i].strジャンル == song.Genre.genre
&& TJAPlayer3.Songs管理.list曲ルート[i].eード種別 == C曲リストード.Eード種別.BOX)
correspondingBox = TJAPlayer3.Songs管理.list曲ルート[i];
}
var newBoxDef = $@"{genredPath}\box.def";
//File.Create(newBoxDef);
StreamWriter sw = new StreamWriter(newBoxDef, false, Encoding.GetEncoding(TJAPlayer3.sEncType));
if (correspondingBox == null)
{
// Generate box.def if none available
//File.Create(newBoxDef);
sw.WriteLine($@"#TITLE:{song.Genre.genre}");
sw.WriteLine($@"#GENRE:{song.Genre.genre}");
sw.WriteLine($@"#BOXEXPLANATION1:");
sw.WriteLine($@"#BOXEXPLANATION2:");
sw.WriteLine($@"#BOXEXPLANATION3:");
sw.WriteLine($@"#BGCOLOR:#ff00a2");
sw.WriteLine($@"#BOXCOLOR:#ff00a2");
sw.WriteLine($@"#BOXTYPE:0");
sw.WriteLine($@"#BGTYPE:1");
sw.WriteLine($@"#BOXCHARA:0");
sw.Close();
StreamWriter sw = new StreamWriter(newBoxDef, false, Encoding.GetEncoding(TJAPlayer3.sEncType));
sw.WriteLine($@"#TITLE:{song.Genre.genre}");
sw.WriteLine($@"#GENRE:{song.Genre.genre}");
sw.WriteLine($@"#BOXEXPLANATION1:");
sw.WriteLine($@"#BOXEXPLANATION2:");
sw.WriteLine($@"#BOXEXPLANATION3:");
sw.WriteLine($@"#BGCOLOR:#ff00a2");
sw.WriteLine($@"#BOXCOLOR:#ff00a2");
sw.WriteLine($@"#BOXTYPE:0");
sw.WriteLine($@"#BGTYPE:1");
sw.WriteLine($@"#BOXCHARA:0");
sw.Close();
}
else
{
// Copy the existing box.def if available
var corPath = correspondingBox.arスコア[0]..;
File.Copy($@"{corPath}\box.def", newBoxDef);
}
}