|
@@ -279,7 +279,7 @@ namespace FNZCM.ConHost.Ver2
|
|
" padding:0.5vh;" +
|
|
" padding:0.5vh;" +
|
|
" border:solid 1px;" +
|
|
" border:solid 1px;" +
|
|
" border-radius:0.5vh;" +
|
|
" border-radius:0.5vh;" +
|
|
- " font-size:2.5vh;" +
|
|
|
|
|
|
+ " font-size:1.5vh;" +
|
|
" overflow:scroll;" +
|
|
" overflow:scroll;" +
|
|
"}" +
|
|
"}" +
|
|
"div.item::-webkit-scrollbar{" +
|
|
"div.item::-webkit-scrollbar{" +
|
|
@@ -291,10 +291,8 @@ namespace FNZCM.ConHost.Ver2
|
|
" max-width:25vw;" +
|
|
" max-width:25vw;" +
|
|
" max-height:20vh" +
|
|
" max-height:20vh" +
|
|
"}" +
|
|
"}" +
|
|
- "div.buttons{" +
|
|
|
|
- "}" +
|
|
|
|
"a.button{" +
|
|
"a.button{" +
|
|
- " margin-left:4vw" +
|
|
|
|
|
|
+ " margin-left:4vw;" +
|
|
"}" +
|
|
"}" +
|
|
"</style>");
|
|
"</style>");
|
|
|
|
|
|
@@ -310,27 +308,28 @@ namespace FNZCM.ConHost.Ver2
|
|
{
|
|
{
|
|
sb.Append("<div class=item>");
|
|
sb.Append("<div class=item>");
|
|
sb.Append($"<img class=cover src=\"/cover/{libName}/{a.Key}/cover.jpg\" />");
|
|
sb.Append($"<img class=cover src=\"/cover/{libName}/{a.Key}/cover.jpg\" />");
|
|
- sb.Append("<div class=buttons>");
|
|
|
|
|
|
+
|
|
|
|
+ sb.Append("<div style=text-align:right>");
|
|
sb.Append($"<a class=button href=\"/list/{libName}/{a.Key}/tracks/\">[TRACKERS]</a>");
|
|
sb.Append($"<a class=button href=\"/list/{libName}/{a.Key}/tracks/\">[TRACKERS]</a>");
|
|
if (a.Value.Bks?.Count > 0) sb.Append($"<a class=button href=\"/list/{libName}/{a.Key}/bk/\">[BK]</a>");
|
|
if (a.Value.Bks?.Count > 0) sb.Append($"<a class=button href=\"/list/{libName}/{a.Key}/bk/\">[BK]</a>");
|
|
|
|
+ sb.Append("</div>");
|
|
|
|
|
|
- var totalDur = a.Value.MainTracks.Sum(p => GetTag($"/media/{libName}/{a.Key}/{p.Key}").Duration);
|
|
|
|
- var totalLen = a.Value.MainTracks.Sum(p => GetTag($"/media/{libName}/{a.Key}/{p.Key}").Length);
|
|
|
|
|
|
+ sb.Append("<div style=text-align:right>");
|
|
|
|
+ var totalDur = a.Value.MainTracks.Sum(p => GetTag($"/media/{libName}/{a.Key}/{p.Key}", true)?.Duration ?? 0);
|
|
|
|
+ var totalLen = a.Value.MainTracks.Sum(p => GetTag($"/media/{libName}/{a.Key}/{p.Key}", true)?.Length ?? 0);
|
|
sb.Append($"<a class=button href=\"/list/{libName}/{a.Key.FuckVlcAndEscape()}/playlist.m3u8\">[M3U8({totalDur.FormatDuration()}){totalLen.FormatFileSize()}]</a>");
|
|
sb.Append($"<a class=button href=\"/list/{libName}/{a.Key.FuckVlcAndEscape()}/playlist.m3u8\">[M3U8({totalDur.FormatDuration()}){totalLen.FormatFileSize()}]</a>");
|
|
-
|
|
|
|
if (a.Value.SubTracks.Count > 0)
|
|
if (a.Value.SubTracks.Count > 0)
|
|
{
|
|
{
|
|
- sb.Append("<br/>");
|
|
|
|
foreach (var subTrack in a.Value.SubTracks)
|
|
foreach (var subTrack in a.Value.SubTracks)
|
|
{
|
|
{
|
|
- totalDur = subTrack.Value.Tracks.Sum(p => GetTag($"/media/{libName}/{a.Key}/{subTrack.Key}/{p.Key}").Duration);
|
|
|
|
- totalLen = subTrack.Value.Tracks.Sum(p => GetTag($"/media/{libName}/{a.Key}/{subTrack.Key}/{p.Key}").Length);
|
|
|
|
- sb.Append($"<a class=button href=\"/list/{libName}/{a.Key.FuckVlcAndEscape()}/{subTrack.Key.FuckVlcAndEscape()}/playlist.m3u8\">[M3U8-{subTrack.Value.Name}({totalDur.FormatDuration()}){totalLen.FormatFileSize()}]</a>");
|
|
|
|
|
|
+ totalDur = subTrack.Value.Tracks.Sum(p => GetTag($"/media/{libName}/{a.Key}/{subTrack.Key}/{p.Key}", true)?.Duration ?? 0);
|
|
|
|
+ totalLen = subTrack.Value.Tracks.Sum(p => GetTag($"/media/{libName}/{a.Key}/{subTrack.Key}/{p.Key}", true)?.Length ?? 0);
|
|
|
|
+ sb.Append($"<br/><a class=button href=\"/list/{libName}/{a.Key.FuckVlcAndEscape()}/{subTrack.Key.FuckVlcAndEscape()}/playlist.m3u8\">[{subTrack.Value.Name}({totalDur.FormatDuration()}){totalLen.FormatFileSize()}]</a>");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
sb.Append("</div>");
|
|
sb.Append("</div>");
|
|
- sb.Append($"<span>{a.Value.Name}<span>");
|
|
|
|
|
|
+
|
|
|
|
+ sb.Append($"<div>{a.Value.Name}</div>");
|
|
sb.Append("</div>");
|
|
sb.Append("</div>");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -639,20 +638,34 @@ namespace FNZCM.ConHost.Ver2
|
|
;
|
|
;
|
|
}
|
|
}
|
|
|
|
|
|
- private static MediaTag2 GetTag(string internalPath)
|
|
|
|
|
|
+ private static MediaTag2 GetTag(string internalPath, bool peek = false)
|
|
{
|
|
{
|
|
- if (false == MediaTags.TryGetValue(internalPath, out var mediaTag) && PathMapping.TryGetValue(internalPath, out var mediaFilePath))
|
|
|
|
|
|
+ if (peek)
|
|
{
|
|
{
|
|
- var fi = new FileInfo(mediaFilePath);
|
|
|
|
- using var tagLib = TagLib.File.Create(mediaFilePath);
|
|
|
|
- mediaTag = MediaTags[internalPath] = new MediaTag2(
|
|
|
|
- $"{string.Join(";", tagLib.Tag.Performers)} - {tagLib.Tag.Title}",
|
|
|
|
- (int)tagLib.Properties.Duration.TotalSeconds,
|
|
|
|
- fi.Length
|
|
|
|
- );
|
|
|
|
|
|
+ if (MediaTags.TryGetValue(internalPath, out var mediaTag))
|
|
|
|
+ {
|
|
|
|
+ return mediaTag;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ if (false == MediaTags.TryGetValue(internalPath, out var mediaTag) && PathMapping.TryGetValue(internalPath, out var mediaFilePath))
|
|
|
|
+ {
|
|
|
|
+ var fi = new FileInfo(mediaFilePath);
|
|
|
|
+ using var tagLib = TagLib.File.Create(mediaFilePath);
|
|
|
|
+ mediaTag = MediaTags[internalPath] = new MediaTag2(
|
|
|
|
+ $"{string.Join(";", tagLib.Tag.Performers)} - {tagLib.Tag.Title}",
|
|
|
|
+ (int)tagLib.Properties.Duration.TotalSeconds,
|
|
|
|
+ fi.Length
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return mediaTag;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
- return mediaTag;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|