small updates, add cache link generator
This commit is contained in:
parent
9fe898f282
commit
7d123e9452
|
@ -37,11 +37,14 @@
|
||||||
var file = $"{talk.Slug}.mp4";
|
var file = $"{talk.Slug}.mp4";
|
||||||
var tagV = c3stream.Conferences.First(c => c.Acronym == Request.Query["c"]).TagVersion;
|
var tagV = c3stream.Conferences.First(c => c.Acronym == Request.Query["c"]).TagVersion;
|
||||||
var eventName = tagV == 0 ? conference.Acronym : talk.Tags[0].Replace("-", "-<br/>");
|
var eventName = tagV == 0 ? conference.Acronym : talk.Tags[0].Replace("-", "-<br/>");
|
||||||
var category = tagV switch {
|
var category = talk.Tags.Count switch {
|
||||||
0 => talk.Tags[0],
|
0 => "<no category>",
|
||||||
1 => talk.Tags[2],
|
1 => talk.Tags[0],
|
||||||
2 => talk.Tags[3],
|
2 => "<no category>",
|
||||||
_ => ""
|
3 => talk.Tags[2],
|
||||||
|
4 => talk.Tags[3],
|
||||||
|
5 => talk.Tags[3],
|
||||||
|
_ => "<unknown tag format>"
|
||||||
};
|
};
|
||||||
<tr>
|
<tr>
|
||||||
<td>@Html.Raw(eventName)</td>
|
<td>@Html.Raw(eventName)</td>
|
||||||
|
@ -56,7 +59,7 @@
|
||||||
else {
|
else {
|
||||||
<td>@talk.Title</td>
|
<td>@talk.Title</td>
|
||||||
}
|
}
|
||||||
<td>@talk.Persons.Aggregate((s, s1) => $"{s}, {s1}")</td>
|
<td>@(talk.Persons.Any() ? talk.Persons.Aggregate((s, s1) => $"{s}, {s1}") : "<no speakers>")</td>
|
||||||
<td>@talk.OriginalLanguage</td>
|
<td>@talk.OriginalLanguage</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="btn-group w-100" role="group">
|
<div class="btn-group w-100" role="group">
|
||||||
|
@ -73,7 +76,7 @@
|
||||||
<i class="fas fa-cloud-download"></i>
|
<i class="fas fa-cloud-download"></i>
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
<a href="/Info?guid=@talk.Guid?.ToString()&bookmark=@Request.Query["bookmark"]" target="_blank" type="button" class="btn btn-primary w-100" data-toggle="tooltip" data-placement="top" title="Info">
|
<a href="/Info?guid=@talk.Guid&bookmark=@Request.Query["bookmark"]" target="_blank" type="button" class="btn btn-primary w-100" data-toggle="tooltip" data-placement="top" title="Info">
|
||||||
<i class="fas fa-info-circle"></i>
|
<i class="fas fa-info-circle"></i>
|
||||||
</a>
|
</a>
|
||||||
@if (isWatched) {
|
@if (isWatched) {
|
||||||
|
|
|
@ -33,13 +33,18 @@
|
||||||
var isMarked = state == "marked";
|
var isMarked = state == "marked";
|
||||||
var file = $"{talk.Slug}.mp4";
|
var file = $"{talk.Slug}.mp4";
|
||||||
var conference = c3stream.GetConferenceByEventGuid(talk.Guid);
|
var conference = c3stream.GetConferenceByEventGuid(talk.Guid);
|
||||||
var eventName = talk.Tags[0].Replace("-", "-<br/>");
|
|
||||||
|
|
||||||
var category = c3stream.GetConferenceByEventGuid(Request.Query["guid"]).TagVersion switch {
|
var tagV = c3stream.Conferences.First(c => c.Acronym == Request.Query["c"]).TagVersion;
|
||||||
0 => talk.Tags[0],
|
var eventName = tagV == 0 ? conference.Acronym : talk.Tags[0].Replace("-", "-<br/>");
|
||||||
1 => talk.Tags[2],
|
|
||||||
2 => talk.Tags[3],
|
var category = talk.Tags.Count switch {
|
||||||
_ => ""
|
0 => "<no category>",
|
||||||
|
1 => talk.Tags[0],
|
||||||
|
2 => "<no category>",
|
||||||
|
3 => talk.Tags[2],
|
||||||
|
4 => talk.Tags[3],
|
||||||
|
5 => talk.Tags[3],
|
||||||
|
_ => "<unknown tag format>"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
27
c3stream.cs
27
c3stream.cs
|
@ -10,18 +10,22 @@ using Microsoft.Extensions.Hosting;
|
||||||
|
|
||||||
namespace c3stream {
|
namespace c3stream {
|
||||||
public static class c3stream {
|
public static class c3stream {
|
||||||
public const string DataPath = "data";
|
public const string DataPath = "data";
|
||||||
public const string DbFile = "c3stream.user.json";
|
public const string DbFile = "c3stream.user.json";
|
||||||
public const string CachePath = "/mnt/storage/archive/Video/congress/";
|
public const string CachePath = "/mnt/storage/archive/Video/congress/";
|
||||||
public const string CacheUrl = "https://mirror.c3stream.de/";
|
public const string CacheUrl = "https://mirror.c3stream.de/";
|
||||||
public static object Lock = new object();
|
public static object Lock = new object();
|
||||||
public static string DbPath = Path.Combine(DataPath, DbFile);
|
public static string DbPath = Path.Combine(DataPath, DbFile);
|
||||||
|
|
||||||
public static List<ConferenceObject> Conferences = new List<ConferenceObject> {
|
public static List<ConferenceObject> Conferences = new List<ConferenceObject> {
|
||||||
new ConferenceObject("36c3", 2, true),
|
new ConferenceObject("36c3", 2, true),
|
||||||
|
new ConferenceObject("camp2019"),
|
||||||
new ConferenceObject("35c3", 1),
|
new ConferenceObject("35c3", 1),
|
||||||
new ConferenceObject("34c3", 1),
|
new ConferenceObject("34c3", 1),
|
||||||
new ConferenceObject("33c3"),
|
new ConferenceObject("33c3"),
|
||||||
new ConferenceObject("32c3"),
|
new ConferenceObject("32c3"),
|
||||||
|
new ConferenceObject("31c3"),
|
||||||
|
new ConferenceObject("30c3")
|
||||||
};
|
};
|
||||||
|
|
||||||
public static void Main(string[] args) {
|
public static void Main(string[] args) {
|
||||||
|
@ -47,7 +51,16 @@ namespace c3stream {
|
||||||
conference.Talks.AddRange(parsed.Events);
|
conference.Talks.AddRange(parsed.Events);
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateHostBuilder(args).Build().Run();
|
if (args.Length != 0) {
|
||||||
|
if (Conferences.All(p => p.Acronym != args[0]))
|
||||||
|
Console.WriteLine("No matching conference found.");
|
||||||
|
else
|
||||||
|
foreach (var talk in Conferences.First(p => p.Acronym == args[0]).Talks)
|
||||||
|
Console.WriteLine($"youtube-dl -f \"best[ext = mp4]\" {talk.FrontendLink} -o \"{Path.Combine(CachePath, args[0], talk.Slug)}.mp4\"");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
CreateHostBuilder(args).Build().Run();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void UpdateCookie(HttpRequest resquest, HttpResponse response, string redirectUri) {
|
public static void UpdateCookie(HttpRequest resquest, HttpResponse response, string redirectUri) {
|
||||||
|
|
Loading…
Reference in a new issue