1
0
mirror of synced 2024-11-30 17:04:28 +01:00

Disable download by default

This commit is contained in:
asesidaa 2022-07-18 15:13:25 +08:00
parent 0d1c3e60cd
commit e5d2724f8c
3 changed files with 58 additions and 4 deletions

View File

@ -40,6 +40,9 @@ public interface IAppSettings
[Option(DefaultValue = Configs.DEFAULT_RELAY_PORT)]
int RelayPort { get; }
[Option(DefaultValue = false)]
bool DownloadEvents { get; }
[Option(DefaultValue = null)]
IEnumerable<int>? UnlockableSongIds { get; }

View File

@ -9,12 +9,59 @@
"MusicDbName": "music471omni.db3",
"ServerIp": "127.0.0.1",
"EventFolder": "event",
"DownloadEvents": false,
"RelayServer": "127.0.0.1",
"RelayPort": 54321,
"UnlockableSongIds": [
11, 13, 149, 273, 291, 320, 321, 371, 378, 384, 464, 471, 474, 475, 492, 494, 498, 520,
548, 551, 558, 561, 565, 570, 577, 583, 612, 615, 622, 632, 659, 666, 668, 670, 672, 676,
680, 682, 685, 686, 697, 700, 701, 711, 720, 749, 875, 876, 877
11,
13,
149,
273,
291,
320,
321,
371,
378,
384,
464,
471,
474,
475,
492,
494,
498,
520,
548,
551,
558,
561,
565,
570,
577,
583,
612,
615,
622,
632,
659,
666,
668,
670,
672,
676,
680,
682,
685,
686,
697,
700,
701,
711,
720,
749,
875,
876,
877
],
"ResponseData": [
{

View File

@ -101,7 +101,11 @@ public class ServerController : WebApiController
for (var i = 0; i < count; i++)
{
var data = responseList[i];
var fileUrl = data.FileName.StartsWith("/") ? $"{DataUrl}{data.FileName}" : $"{DataUrl}/{data.FileName}";
var fileUrl = data.FileName;
if (Configs.SETTINGS.DownloadEvents)
{
fileUrl = data.FileName.StartsWith("/") ? $"{DataUrl}{data.FileName}" : $"{DataUrl}/{data.FileName}";
}
dataString.Append($"{i},{fileUrl},{data.NotBeforeUnixTime},{data.NotAfterUnixTime},{data.Md5},{data.Index}");
dataString.Append('\n');
}