@Html.Raw(eventName) |
@@ -56,7 +59,7 @@
else {
@talk.Title |
}
- @talk.Persons.Aggregate((s, s1) => $"{s}, {s1}") |
+ @(talk.Persons.Any() ? talk.Persons.Aggregate((s, s1) => $"{s}, {s1}") : "") |
@talk.OriginalLanguage |
@@ -73,7 +76,7 @@
}
-
+
@if (isWatched) {
diff --git a/Pages/Info.cshtml b/Pages/Info.cshtml
index 497facd..ce7a77a 100644
--- a/Pages/Info.cshtml
+++ b/Pages/Info.cshtml
@@ -33,13 +33,18 @@
var isMarked = state == "marked";
var file = $"{talk.Slug}.mp4";
var conference = c3stream.GetConferenceByEventGuid(talk.Guid);
- var eventName = talk.Tags[0].Replace("-", "- ");
- var category = c3stream.GetConferenceByEventGuid(Request.Query["guid"]).TagVersion switch {
- 0 => talk.Tags[0],
- 1 => talk.Tags[2],
- 2 => talk.Tags[3],
- _ => ""
+ var tagV = c3stream.Conferences.First(c => c.Acronym == Request.Query["c"]).TagVersion;
+ var eventName = tagV == 0 ? conference.Acronym : talk.Tags[0].Replace("-", "- ");
+
+ var category = talk.Tags.Count switch {
+ 0 => " ",
+ 1 => talk.Tags[0],
+ 2 => "",
+ 3 => talk.Tags[2],
+ 4 => talk.Tags[3],
+ 5 => talk.Tags[3],
+ _ => ""
};
}
diff --git a/c3stream.cs b/c3stream.cs
index 41aedfc..4a8ad6d 100644
--- a/c3stream.cs
+++ b/c3stream.cs
@@ -10,18 +10,22 @@ using Microsoft.Extensions.Hosting;
namespace c3stream {
public static class c3stream {
- public const string DataPath = "data";
- public const string DbFile = "c3stream.user.json";
- public const string CachePath = "/mnt/storage/archive/Video/congress/";
- public const string CacheUrl = "https://mirror.c3stream.de/";
- public static object Lock = new object();
- public static string DbPath = Path.Combine(DataPath, DbFile);
+ public const string DataPath = "data";
+ public const string DbFile = "c3stream.user.json";
+ public const string CachePath = "/mnt/storage/archive/Video/congress/";
+ public const string CacheUrl = "https://mirror.c3stream.de/";
+ public static object Lock = new object();
+ public static string DbPath = Path.Combine(DataPath, DbFile);
+
public static List Conferences = new List {
new ConferenceObject("36c3", 2, true),
+ new ConferenceObject("camp2019"),
new ConferenceObject("35c3", 1),
new ConferenceObject("34c3", 1),
new ConferenceObject("33c3"),
new ConferenceObject("32c3"),
+ new ConferenceObject("31c3"),
+ new ConferenceObject("30c3")
};
public static void Main(string[] args) {
@@ -47,7 +51,16 @@ namespace c3stream {
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) {
|