Compare commits
No commits in common. "v5" and "v4" have entirely different histories.
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -2,5 +2,3 @@ bin/
|
||||||
obj/
|
obj/
|
||||||
/packages/
|
/packages/
|
||||||
/data/
|
/data/
|
||||||
migration.sql
|
|
||||||
.idea/
|
|
||||||
|
|
0
.idea/.gitignore
vendored
Normal file
0
.idea/.gitignore
vendored
Normal file
2
.idea/.idea.c3stream/.idea/.gitignore
vendored
Normal file
2
.idea/.idea.c3stream/.idea/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# Default ignored files
|
||||||
|
/workspace.xml
|
140
.idea/.idea.c3stream/.idea/contentModel.xml
Normal file
140
.idea/.idea.c3stream/.idea/contentModel.xml
Normal file
|
@ -0,0 +1,140 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ContentModelStore">
|
||||||
|
<e p="$USER_HOME$/.cache/JetBrains/Rider2020.3/extResources" t="IncludeRecursive" />
|
||||||
|
<e p="$USER_HOME$/.cache/JetBrains/Rider2020.3/resharper-host/local/Transient/Rider/v203/SolutionCaches/_c3stream.-187536235.00" t="ExcludeRecursive" />
|
||||||
|
<e p="$PROJECT_DIR$" t="IncludeRecursive">
|
||||||
|
<e p=".gitignore" t="Include" />
|
||||||
|
<e p="LICENSE" t="Include" />
|
||||||
|
<e p="Pages" t="Include">
|
||||||
|
<e p="Conference.cshtml" t="Include" />
|
||||||
|
<e p="Conference.cshtml.cs" t="Include" />
|
||||||
|
<e p="Error.cshtml" t="Include" />
|
||||||
|
<e p="Error.cshtml.cs" t="Include" />
|
||||||
|
<e p="Index.cshtml" t="Include" />
|
||||||
|
<e p="Index.cshtml.cs" t="Include" />
|
||||||
|
<e p="Info.cshtml" t="Include" />
|
||||||
|
<e p="Info.cshtml.cs" t="Include" />
|
||||||
|
<e p="Privacy.cshtml" t="Include" />
|
||||||
|
<e p="Privacy.cshtml.cs" t="Include" />
|
||||||
|
<e p="Shared" t="Include">
|
||||||
|
<e p="_Layout.cshtml" t="Include" />
|
||||||
|
<e p="_ValidationScriptsPartial.cshtml" t="Include" />
|
||||||
|
</e>
|
||||||
|
<e p="_ViewImports.cshtml" t="Include" />
|
||||||
|
<e p="_ViewStart.cshtml" t="Include" />
|
||||||
|
</e>
|
||||||
|
<e p="Properties" t="Include">
|
||||||
|
<e p="launchSettings.json" t="Include" />
|
||||||
|
</e>
|
||||||
|
<e p="README.md" t="Include" />
|
||||||
|
<e p="Startup.cs" t="Include" />
|
||||||
|
<e p="Types.cs" t="Include" />
|
||||||
|
<e p="appsettings.Development.json" t="Include" />
|
||||||
|
<e p="appsettings.json" t="Include" />
|
||||||
|
<e p="bin" t="ExcludeRecursive" />
|
||||||
|
<e p="c3stream.cs" t="Include" />
|
||||||
|
<e p="c3stream.csproj" t="IncludeRecursive" />
|
||||||
|
<e p="c3stream.sln" t="IncludeFlat" />
|
||||||
|
<e p="obj" t="ExcludeRecursive">
|
||||||
|
<e p="Debug" t="Include">
|
||||||
|
<e p="netcoreapp3.1" t="Include">
|
||||||
|
<e p="c3stream.AssemblyInfo.cs" t="Include" />
|
||||||
|
<e p="c3stream.RazorAssemblyInfo.cs" t="Include" />
|
||||||
|
</e>
|
||||||
|
</e>
|
||||||
|
</e>
|
||||||
|
<e p="packages" t="ExcludeRecursive" />
|
||||||
|
<e p="wwwroot" t="Include">
|
||||||
|
<e p="css" t="Include">
|
||||||
|
<e p="fa.css" t="Include" />
|
||||||
|
<e p="site.css" t="Include" />
|
||||||
|
</e>
|
||||||
|
<e p="favicon.ico" t="Include" />
|
||||||
|
<e p="js" t="Include">
|
||||||
|
<e p="site.js" t="Include" />
|
||||||
|
</e>
|
||||||
|
<e p="lib" t="Include">
|
||||||
|
<e p="bootstrap" t="Include">
|
||||||
|
<e p="LICENSE" t="Include" />
|
||||||
|
<e p="dist" t="Include">
|
||||||
|
<e p="css" t="Include">
|
||||||
|
<e p="bootstrap-grid.css" t="Include" />
|
||||||
|
<e p="bootstrap-grid.css.map" t="Include" />
|
||||||
|
<e p="bootstrap-grid.min.css" t="Include" />
|
||||||
|
<e p="bootstrap-grid.min.css.map" t="Include" />
|
||||||
|
<e p="bootstrap-reboot.css" t="Include" />
|
||||||
|
<e p="bootstrap-reboot.css.map" t="Include" />
|
||||||
|
<e p="bootstrap-reboot.min.css" t="Include" />
|
||||||
|
<e p="bootstrap-reboot.min.css.map" t="Include" />
|
||||||
|
<e p="bootstrap.css" t="Include" />
|
||||||
|
<e p="bootstrap.css.map" t="Include" />
|
||||||
|
<e p="bootstrap.min.css" t="Include" />
|
||||||
|
<e p="bootstrap.min.css.map" t="Include" />
|
||||||
|
</e>
|
||||||
|
<e p="js" t="Include">
|
||||||
|
<e p="bootstrap.bundle.js" t="Include" />
|
||||||
|
<e p="bootstrap.bundle.js.map" t="Include" />
|
||||||
|
<e p="bootstrap.bundle.min.js" t="Include" />
|
||||||
|
<e p="bootstrap.bundle.min.js.map" t="Include" />
|
||||||
|
<e p="bootstrap.js" t="Include" />
|
||||||
|
<e p="bootstrap.js.map" t="Include" />
|
||||||
|
<e p="bootstrap.min.js" t="Include" />
|
||||||
|
<e p="bootstrap.min.js.map" t="Include" />
|
||||||
|
</e>
|
||||||
|
</e>
|
||||||
|
</e>
|
||||||
|
<e p="jquery" t="Include">
|
||||||
|
<e p="LICENSE.txt" t="Include" />
|
||||||
|
<e p="dist" t="Include">
|
||||||
|
<e p="jquery.js" t="Include" />
|
||||||
|
<e p="jquery.min.js" t="Include" />
|
||||||
|
<e p="jquery.min.map" t="Include" />
|
||||||
|
</e>
|
||||||
|
</e>
|
||||||
|
<e p="jquery-validation" t="Include">
|
||||||
|
<e p="LICENSE.md" t="Include" />
|
||||||
|
<e p="dist" t="Include">
|
||||||
|
<e p="additional-methods.js" t="Include" />
|
||||||
|
<e p="additional-methods.min.js" t="Include" />
|
||||||
|
<e p="jquery.validate.js" t="Include" />
|
||||||
|
<e p="jquery.validate.min.js" t="Include" />
|
||||||
|
</e>
|
||||||
|
</e>
|
||||||
|
<e p="jquery-validation-unobtrusive" t="Include">
|
||||||
|
<e p="LICENSE.txt" t="Include" />
|
||||||
|
<e p="jquery.validate.unobtrusive.js" t="Include" />
|
||||||
|
<e p="jquery.validate.unobtrusive.min.js" t="Include" />
|
||||||
|
</e>
|
||||||
|
</e>
|
||||||
|
<e p="webfonts" t="Include">
|
||||||
|
<e p="fa-brands-400.eot" t="Include" />
|
||||||
|
<e p="fa-brands-400.svg" t="Include" />
|
||||||
|
<e p="fa-brands-400.ttf" t="Include" />
|
||||||
|
<e p="fa-brands-400.woff" t="Include" />
|
||||||
|
<e p="fa-brands-400.woff2" t="Include" />
|
||||||
|
<e p="fa-duotone-900.eot" t="Include" />
|
||||||
|
<e p="fa-duotone-900.svg" t="Include" />
|
||||||
|
<e p="fa-duotone-900.ttf" t="Include" />
|
||||||
|
<e p="fa-duotone-900.woff" t="Include" />
|
||||||
|
<e p="fa-duotone-900.woff2" t="Include" />
|
||||||
|
<e p="fa-light-300.eot" t="Include" />
|
||||||
|
<e p="fa-light-300.svg" t="Include" />
|
||||||
|
<e p="fa-light-300.ttf" t="Include" />
|
||||||
|
<e p="fa-light-300.woff" t="Include" />
|
||||||
|
<e p="fa-light-300.woff2" t="Include" />
|
||||||
|
<e p="fa-regular-400.eot" t="Include" />
|
||||||
|
<e p="fa-regular-400.svg" t="Include" />
|
||||||
|
<e p="fa-regular-400.ttf" t="Include" />
|
||||||
|
<e p="fa-regular-400.woff" t="Include" />
|
||||||
|
<e p="fa-regular-400.woff2" t="Include" />
|
||||||
|
<e p="fa-solid-900.eot" t="Include" />
|
||||||
|
<e p="fa-solid-900.svg" t="Include" />
|
||||||
|
<e p="fa-solid-900.ttf" t="Include" />
|
||||||
|
<e p="fa-solid-900.woff" t="Include" />
|
||||||
|
<e p="fa-solid-900.woff2" t="Include" />
|
||||||
|
</e>
|
||||||
|
</e>
|
||||||
|
</e>
|
||||||
|
</component>
|
||||||
|
</project>
|
4
.idea/.idea.c3stream/.idea/encodings.xml
Normal file
4
.idea/.idea.c3stream/.idea/encodings.xml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||||
|
</project>
|
8
.idea/.idea.c3stream/.idea/indexLayout.xml
Normal file
8
.idea/.idea.c3stream/.idea/indexLayout.xml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ContentModelUserStore">
|
||||||
|
<attachedFolders />
|
||||||
|
<explicitIncludes />
|
||||||
|
<explicitExcludes />
|
||||||
|
</component>
|
||||||
|
</project>
|
6
.idea/.idea.c3stream/.idea/jsLibraryMappings.xml
Normal file
6
.idea/.idea.c3stream/.idea/jsLibraryMappings.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="JavaScriptLibraryMappings">
|
||||||
|
<file url="PROJECT" libraries="{all, c1a632a160}" />
|
||||||
|
</component>
|
||||||
|
</project>
|
6
.idea/.idea.c3stream/.idea/misc.xml
Normal file
6
.idea/.idea.c3stream/.idea/misc.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="com.jetbrains.rider.android.RiderAndroidMiscFileCreationComponent">
|
||||||
|
<option name="ENSURE_MISC_FILE_EXISTS" value="true" />
|
||||||
|
</component>
|
||||||
|
</project>
|
8
.idea/.idea.c3stream/.idea/modules.xml
Normal file
8
.idea/.idea.c3stream/.idea/modules.xml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/.idea.c3stream/.idea/riderModule.iml" filepath="$PROJECT_DIR$/.idea/.idea.c3stream/.idea/riderModule.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
6
.idea/.idea.c3stream/.idea/projectSettingsUpdater.xml
Normal file
6
.idea/.idea.c3stream/.idea/projectSettingsUpdater.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="RiderProjectSettingsUpdater">
|
||||||
|
<option name="vcsConfiguration" value="2" />
|
||||||
|
</component>
|
||||||
|
</project>
|
7
.idea/.idea.c3stream/.idea/riderModule.iml
Normal file
7
.idea/.idea.c3stream/.idea/riderModule.iml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="RIDER_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$/../.." />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
6
.idea/.idea.c3stream/.idea/vcs.xml
Normal file
6
.idea/.idea.c3stream/.idea/vcs.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
9
.idea/.idea.c3stream/riderModule.iml
Normal file
9
.idea/.idea.c3stream/riderModule.iml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="RIDER_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$/../.." />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="library" name="c1a632a160" level="application" />
|
||||||
|
<orderEntry type="library" name="all" level="application" />
|
||||||
|
</component>
|
||||||
|
</module>
|
|
@ -1,35 +0,0 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using c3stream.DataModels.Tables;
|
|
||||||
using LinqToDB;
|
|
||||||
using LinqToDB.Configuration;
|
|
||||||
using LinqToDB.Data;
|
|
||||||
|
|
||||||
namespace c3stream.DataModels;
|
|
||||||
|
|
||||||
public class Database {
|
|
||||||
public class ConnectionStringSettings : IConnectionStringSettings {
|
|
||||||
public string ConnectionString { get; set; }
|
|
||||||
public string Name { get; set; }
|
|
||||||
public string ProviderName { get; set; }
|
|
||||||
public bool IsGlobal => false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Settings : ILinqToDBSettings {
|
|
||||||
public IEnumerable<IDataProviderSettings> DataProviders => Enumerable.Empty<IDataProviderSettings>();
|
|
||||||
|
|
||||||
public string DefaultConfiguration => "SQLite";
|
|
||||||
public string DefaultDataProvider => "SQLite";
|
|
||||||
|
|
||||||
public IEnumerable<IConnectionStringSettings> ConnectionStrings {
|
|
||||||
get { yield return new ConnectionStringSettings { Name = "db", ProviderName = "SQLite", ConnectionString = @"Data Source=data/c3stream.sqlite;" }; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class DbConn : DataConnection {
|
|
||||||
public DbConn() : base("db") { }
|
|
||||||
|
|
||||||
public ITable<States> States => GetTable<States>();
|
|
||||||
public ITable<DbInfo> DbInfo => GetTable<DbInfo>();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
using LinqToDB.Mapping;
|
|
||||||
|
|
||||||
namespace c3stream.DataModels.Tables;
|
|
||||||
|
|
||||||
[Table(Name = "DbInfo")]
|
|
||||||
public class DbInfo {
|
|
||||||
[Column(Name = "ID"), PrimaryKey, Identity, NotNull] public int Id { get; set; }
|
|
||||||
[Column(Name = "DbVer"), NotNull] public int DbVer { get; set; }
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
using LinqToDB.Mapping;
|
|
||||||
|
|
||||||
namespace c3stream.DataModels.Tables;
|
|
||||||
|
|
||||||
[Table(Name = "States")]
|
|
||||||
public class States {
|
|
||||||
[Column(Name = "TalkId"), PrimaryKey, NotNull] public string TalkId { get; set; }
|
|
||||||
[Column(Name = "UserId"), PrimaryKey, NotNull] public string UserId { get; set; }
|
|
||||||
[Column(Name = "State"), NotNull] public string State { get; set; }
|
|
||||||
}
|
|
5
LICENSE
5
LICENSE
|
@ -1,4 +1,4 @@
|
||||||
Be Gay, Do Crimes License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2020 Laura Hausmann
|
Copyright (c) 2020 Laura Hausmann
|
||||||
|
|
||||||
|
@ -9,9 +9,6 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
furnished to do so, subject to the following conditions:
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
Be Gay
|
|
||||||
Do Crimes
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
The above copyright notice and this permission notice shall be included in all
|
||||||
copies or substantial portions of the Software.
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
|
|
@ -1,90 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using c3stream.DataModels;
|
|
||||||
using c3stream.DataModels.Tables;
|
|
||||||
using LinqToDB;
|
|
||||||
using LinqToDB.Data;
|
|
||||||
|
|
||||||
namespace c3stream;
|
|
||||||
|
|
||||||
public static class Migrations {
|
|
||||||
private const int DbVer = 0;
|
|
||||||
|
|
||||||
private static readonly List<Migration> _migrations = new();
|
|
||||||
|
|
||||||
public static void RunMigrations() {
|
|
||||||
using var db = new Database.DbConn();
|
|
||||||
var ccolor = Console.ForegroundColor;
|
|
||||||
|
|
||||||
if (!db.DataProvider.GetSchemaProvider().GetSchema(db).Tables.Any()) {
|
|
||||||
Console.ForegroundColor = ConsoleColor.DarkCyan;
|
|
||||||
Console.Write("Running migration: ");
|
|
||||||
Console.ForegroundColor = ConsoleColor.Yellow;
|
|
||||||
Console.WriteLine("Initialize Database");
|
|
||||||
|
|
||||||
db.CreateTable<States>();
|
|
||||||
db.CreateTable<DbInfo>();
|
|
||||||
db.InsertWithIdentity(new DbInfo { DbVer = DbVer });
|
|
||||||
}
|
|
||||||
else if (db.DataProvider.GetSchemaProvider().GetSchema(db).Tables.All(t => t.TableName != "DbInfo")) {
|
|
||||||
db.CreateTable<DbInfo>();
|
|
||||||
db.InsertWithIdentity(new DbInfo { DbVer = 0 });
|
|
||||||
}
|
|
||||||
|
|
||||||
Console.ForegroundColor = ConsoleColor.Yellow;
|
|
||||||
Console.WriteLine($"Database version: {db.DbInfo.ToList().First().DbVer}");
|
|
||||||
|
|
||||||
var migrationsToRun = _migrations.FindAll(p => p.IntroducedWithDbVer > db.DbInfo.First().DbVer);
|
|
||||||
if (migrationsToRun.Count == 0) {
|
|
||||||
Console.ForegroundColor = ConsoleColor.Green;
|
|
||||||
Console.WriteLine("No migrations to run.");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
new Migration(0, "BEGIN TRANSACTION").Run(db);
|
|
||||||
try {
|
|
||||||
migrationsToRun.ForEach(p => p.Run(db));
|
|
||||||
}
|
|
||||||
catch {
|
|
||||||
Console.ForegroundColor = ConsoleColor.DarkRed;
|
|
||||||
Console.WriteLine($"Migrating to database version {DbVer} failed.");
|
|
||||||
new Migration(0, "ROLLBACK TRANSACTION").Run(db);
|
|
||||||
Console.ForegroundColor = ConsoleColor.DarkYellow;
|
|
||||||
Console.WriteLine("Rolled back migrations.");
|
|
||||||
Environment.Exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
new Migration(0, "COMMIT TRANSACTION").Run(db);
|
|
||||||
|
|
||||||
var newdb = new Database.DbConn();
|
|
||||||
var dbinfo = newdb.DbInfo.First();
|
|
||||||
dbinfo.DbVer = DbVer;
|
|
||||||
newdb.Update(dbinfo);
|
|
||||||
|
|
||||||
Console.ForegroundColor = ConsoleColor.DarkGreen;
|
|
||||||
Console.WriteLine($"Database version is now: {DbVer}");
|
|
||||||
Console.ForegroundColor = ConsoleColor.Green;
|
|
||||||
Console.WriteLine("Finished running migrations.");
|
|
||||||
}
|
|
||||||
|
|
||||||
Console.ForegroundColor = ccolor;
|
|
||||||
}
|
|
||||||
|
|
||||||
private class Migration {
|
|
||||||
private readonly string _sql;
|
|
||||||
public readonly int IntroducedWithDbVer;
|
|
||||||
|
|
||||||
public Migration(int introducedWithDbVer, string sql) {
|
|
||||||
IntroducedWithDbVer = introducedWithDbVer;
|
|
||||||
_sql = sql;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Run(DataConnection db) {
|
|
||||||
Console.ForegroundColor = ConsoleColor.DarkCyan;
|
|
||||||
Console.Write("Running migration: ");
|
|
||||||
Console.ForegroundColor = ConsoleColor.Yellow;
|
|
||||||
Console.WriteLine(_sql);
|
|
||||||
db.Execute(_sql);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,114 +1,114 @@
|
||||||
@page
|
@page
|
||||||
@using global::c3stream.DataModels
|
|
||||||
@model ConferenceModel
|
@model ConferenceModel
|
||||||
|
@using System.Net
|
||||||
|
@using static ConferenceModel
|
||||||
@{
|
@{
|
||||||
if (c3stream.Conferences.All(c => c.Acronym != Request.Query["c"])) {
|
if (c3stream.Conferences.All(c => c.Acronym != Request.Query["c"])) {
|
||||||
Response.Redirect("/");
|
Response.Redirect("/");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var cookie = c3stream.UpdateCookie(Request, Response, $"/Conference?c={Request.Query["c"]}");
|
c3stream.UpdateCookie(Request, Response, $"/Conference?c={Request.Query["c"]}");
|
||||||
ViewData["Title"] = Request.Query["c"];
|
ReadUserData();
|
||||||
var conference = c3stream.Conferences.First(c => c.Acronym == Request.Query["c"]);
|
ViewData["Title"] = Request.Query["c"];
|
||||||
if (conference.Ongoing) {
|
var wc = new WebClient();
|
||||||
c3stream.UpdateConference(conference);
|
var conference = c3stream.Conferences.First(c => c.Acronym == Request.Query["c"]);
|
||||||
}
|
if (conference.Ongoing) {
|
||||||
await using var db = new Database.DbConn();
|
c3stream.UpdateConference(conference);
|
||||||
var states = db.States.ToList();
|
}
|
||||||
|
wc.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">Event</th>
|
<th scope="col">Event</th>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
@Html.Raw(Request.Query["orderby"] == "published" ? $"<a href=\"/Conference?c={Request.Query["c"]}\">Published" : $"<a href=\"/Conference?c={Request.Query["c"]}&orderby=published\">Date")
|
@Html.Raw(Request.Query["orderby"] == "published" ? $"<a href=\"/Conference?c={Request.Query["c"]}\">Published" : $"<a href=\"/Conference?c={Request.Query["c"]}&orderby=published\">Date")</th>
|
||||||
</th>
|
<th scope="col">Category</th>
|
||||||
<th scope="col">Category</th>
|
<th scope="col">Title</th>
|
||||||
<th scope="col">Title</th>
|
<th scope="col">Speaker(s)</th>
|
||||||
<th scope="col">Speaker(s)</th>
|
<th scope="col">Lang</th>
|
||||||
<th scope="col">Lang</th>
|
<th scope="col">Actions</th>
|
||||||
<th scope="col">Actions</th>
|
</tr>
|
||||||
</tr>
|
</thead>
|
||||||
</thead>
|
<tbody>
|
||||||
<tbody>
|
@foreach (var talk in Request.Query["orderby"] == "published" ? conference.Talks.OrderByDescending(p => p.ReleaseDate) : conference.Talks.OrderBy(p => p.Date)) {
|
||||||
@foreach (var talk in Request.Query["orderby"] == "published" ? conference.Talks.OrderByDescending(p => p.ReleaseDate) : conference.Talks.OrderBy(p => p.Date)) {
|
var state = UserData.FirstOrDefault(p => p.TalkId == talk.Guid && p.UserId == Request.Cookies["bookmark"])?.State;
|
||||||
var state = states.FirstOrDefault(p => p.TalkId == talk.Guid && p.UserId == cookie)?.State;
|
var isWatched = state == "watched";
|
||||||
var isWatched = state == "watched";
|
var isMarked = state == "marked";
|
||||||
var isMarked = state == "marked";
|
var file = $"{talk.Slug}.mp4";
|
||||||
var file = $"{talk.Slug}.mp4";
|
var eventName = talk.Tags.Count <= 1 ? conference.Acronym : talk.Tags[0].Replace("-", "-<br/>");
|
||||||
var eventName = talk.Tags.Count <= 1 ? conference.Acronym : talk.Tags[0].Replace("-", "-<br/>");
|
var category = talk.Tags.Count switch {
|
||||||
var category = talk.Tags.Count switch {
|
0 => "<no category>",
|
||||||
0 => "<no category>",
|
1 => talk.Tags[0],
|
||||||
1 => talk.Tags[0],
|
2 => "<no category>",
|
||||||
2 => "<no category>",
|
3 => talk.Tags[2],
|
||||||
3 => talk.Tags[2],
|
4 => talk.Tags[3],
|
||||||
4 => talk.Tags[3],
|
5 => talk.Tags[3],
|
||||||
5 => talk.Tags[3],
|
6 => talk.Tags[3], // rc3: is this correct?
|
||||||
6 => talk.Tags[3],
|
_ => "<unknown tag format>"
|
||||||
7 => talk.Tags[3],
|
};
|
||||||
_ => "<unknown tag format>"
|
<tr>
|
||||||
};
|
<td>@Html.Raw(eventName)</td>
|
||||||
<tr>
|
<td>@(Request.Query["orderby"] == "published" ? talk.ReleaseDate?.Date.ToShortDateString() : talk.Date?.Date.ToShortDateString())</td>
|
||||||
<td>@Html.Raw(eventName)</td>
|
<td>@category</td>
|
||||||
<td class="text-nowrap">@(Request.Query["orderby"] == "published" ? talk.ReleaseDate?.Date.ToString("yyyy-MM-dd") : talk.Date?.Date.ToString("yyyy-MM-dd"))</td>
|
@if (isWatched) {
|
||||||
<td>@category</td>
|
<td style="color: #95cb7a">@talk.Title</td>
|
||||||
@if (isWatched) {
|
}
|
||||||
<td style="color: #95cb7a">@talk.Title</td>
|
else if (isMarked) {
|
||||||
}
|
<td style="color: #da7d4f">@talk.Title</td>
|
||||||
else if (isMarked) {
|
}
|
||||||
<td style="color: #da7d4f">@talk.Title</td>
|
else {
|
||||||
}
|
<td>@talk.Title</td>
|
||||||
else {
|
}
|
||||||
<td>@talk.Title</td>
|
<td>@(talk.Persons.Any() ? talk.Persons.Aggregate((s, s1) => $"{s}, {s1}") : "<no speakers>")</td>
|
||||||
}
|
<td>@talk.OriginalLanguage</td>
|
||||||
<td>@(talk.Persons.Any() ? talk.Persons.Aggregate((s, s1) => $"{s}, {s1}") : "<no speakers>")</td>
|
<td>
|
||||||
<td>@talk.OriginalLanguage</td>
|
<div class="btn-group" role="group">
|
||||||
<td>
|
<a href="@talk.FrontendLink.AbsoluteUri" role="button" class="btn btn-primary w-100" data-toggle="tooltip" data-placement="top" title="Play">
|
||||||
<div class="btn-group" role="group">
|
<i class="fas fa-play-circle"></i>
|
||||||
<a href="@talk.FrontendLink.AbsoluteUri" role="button" class="btn btn-primary btn-c3saction w-100" data-toggle="tooltip" data-placement="top" title="Play">
|
</a>
|
||||||
<i class="fas fa-play-circle"></i>
|
@if (System.IO.File.Exists(System.IO.Path.Combine(c3stream.CachePath, conference.Acronym, file))) {
|
||||||
</a>
|
<a href="@(c3stream.CacheUrl + $"{conference.Acronym}/{file}")" role="button" class="btn btn-primary w-100" data-toggle="tooltip" data-placement="top" title="Mirror">
|
||||||
@if (System.IO.File.Exists(System.IO.Path.Combine(c3stream.CachePath, conference.Acronym, file))) {
|
<i class="fas fa-cloud-download"></i>
|
||||||
<a href="@(c3stream.CacheUrl + $"{conference.Acronym}/{file}")" role="button" class="btn btn-primary btn-c3saction w-100" data-toggle="tooltip" data-placement="top" title="Mirror">
|
</a>
|
||||||
<i class="fas fa-cloud-download"></i>
|
}
|
||||||
</a>
|
else {
|
||||||
}
|
<a href="/" role="button" class="btn btn-primary disabled">
|
||||||
else {
|
<i class="fas fa-cloud-download"></i>
|
||||||
<a href="/" role="button" class="btn btn-primary btn-c3saction disabled">
|
</a>
|
||||||
<i class="fas fa-cloud-download"></i>
|
}
|
||||||
</a>
|
<a href="/Info?guid=@talk.Guid" role="button" class="btn btn-primary w-100" data-toggle="tooltip" data-placement="top" title="Info">
|
||||||
}
|
<i class="fas fa-info-circle"></i>
|
||||||
<a href="/Info?guid=@talk.Guid" role="button" class="btn btn-primary btn-c3saction w-100" data-toggle="tooltip" data-placement="top" title="Info">
|
</a>
|
||||||
<i class="fas fa-info-circle"></i>
|
@if (isWatched) {
|
||||||
</a>
|
<button onclick="SetState('@talk.Guid', 'unwatched')" class="btn btn-primary w-100" data-toggle="tooltip" data-placement="top" title="Mark unwatched">
|
||||||
@if (isWatched) {
|
<i class="fas fa-times"></i>
|
||||||
<button onclick="SetState('@talk.Guid', 'unwatched')" class="btn btn-primary btn-c3saction w-100" data-toggle="tooltip" data-placement="top" title="Mark unwatched">
|
</button>
|
||||||
<i class="fas fa-times"></i>
|
<button class="btn btn-primary disabled">
|
||||||
</button>
|
<i class="fas fa-clock"></i>
|
||||||
<button class="btn btn-primary btn-c3saction disabled" disabled>
|
</button>
|
||||||
<i class="fas fa-clock"></i>
|
}
|
||||||
</button>
|
else if (isMarked) {
|
||||||
}
|
<button onclick="SetState('@talk.Guid', 'watched')" class="btn btn-primary w-100" data-toggle="tooltip" data-placement="top" title="Mark watched">
|
||||||
else if (isMarked) {
|
<i class="fas fa-check"></i>
|
||||||
<button onclick="SetState('@talk.Guid', 'watched')" class="btn btn-primary btn-c3saction w-100" data-toggle="tooltip" data-placement="top" title="Mark watched">
|
</button>
|
||||||
<i class="fas fa-check"></i>
|
<button onclick="SetState('@talk.Guid', 'unwatched')" class="btn btn-primary w-100" data-toggle="tooltip" data-placement="top" title="Remove from watch later">
|
||||||
</button>
|
<i class="fas fa-undo-alt"></i>
|
||||||
<button onclick="SetState('@talk.Guid', 'unwatched')" class="btn btn-primary btn-c3saction w-100" data-toggle="tooltip" data-placement="top" title="Remove from watch later">
|
</button>
|
||||||
<i class="fas fa-undo-alt"></i>
|
}
|
||||||
</button>
|
else {
|
||||||
}
|
<button onclick="SetState('@talk.Guid', 'watched')" class="btn btn-primary w-100" data-toggle="tooltip" data-placement="top" title="Mark watched">
|
||||||
else {
|
<i class="fas fa-check"></i>
|
||||||
<button onclick="SetState('@talk.Guid', 'watched')" class="btn btn-primary btn-c3saction w-100" data-toggle="tooltip" data-placement="top" title="Mark watched">
|
</button>
|
||||||
<i class="fas fa-check"></i>
|
<button onclick="SetState('@talk.Guid', 'marked')" class="btn btn-primary w-100" data-toggle="tooltip" data-placement="top" title="Add to watch later">
|
||||||
</button>
|
<i class="fas fa-clock"></i>
|
||||||
<button onclick="SetState('@talk.Guid', 'marked')" class="btn btn-primary btn-c3saction w-100" data-toggle="tooltip" data-placement="top" title="Add to watch later">
|
</button>
|
||||||
<i class="fas fa-clock"></i>
|
}
|
||||||
</button>
|
</div>
|
||||||
}
|
</td>
|
||||||
</div>
|
</tr>
|
||||||
</td>
|
}
|
||||||
</tr>
|
</tbody>
|
||||||
}
|
</table>
|
||||||
</tbody>
|
|
||||||
</table>
|
|
|
@ -1,37 +1,58 @@
|
||||||
using System.Linq;
|
using System.Collections.Generic;
|
||||||
using c3stream.DataModels;
|
using System.Linq;
|
||||||
using c3stream.DataModels.Tables;
|
|
||||||
using LinqToDB;
|
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace c3stream.Pages;
|
namespace c3stream.Pages {
|
||||||
|
public class ConferenceModel : PageModel {
|
||||||
|
public static List<UserStatus> UserData = new List<UserStatus>();
|
||||||
|
private readonly ILogger<ConferenceModel> _logger;
|
||||||
|
|
||||||
public class ConferenceModel : PageModel {
|
public ConferenceModel(ILogger<ConferenceModel> logger) => _logger = logger;
|
||||||
private readonly ILogger<ConferenceModel> _logger;
|
|
||||||
|
|
||||||
public ConferenceModel(ILogger<ConferenceModel> logger) => _logger = logger;
|
public void OnGet() {
|
||||||
|
var guid = Request.Query["guid"];
|
||||||
|
var state = Request.Query["state"];
|
||||||
|
var userid = Request.Cookies["bookmark"];
|
||||||
|
if (string.IsNullOrWhiteSpace(guid) || string.IsNullOrWhiteSpace(state) || !Request.Cookies.ContainsKey("bookmark"))
|
||||||
|
return;
|
||||||
|
|
||||||
public void OnGet() {
|
lock (c3stream.Lock) {
|
||||||
var guid = Request.Query["guid"].ToString();
|
ReadUserData();
|
||||||
var state = Request.Query["state"].ToString();
|
var existing = UserData.FirstOrDefault(p => p.TalkId == guid && p.UserId == userid);
|
||||||
var userid = Request.Cookies["bookmark"];
|
if (existing != null)
|
||||||
if (string.IsNullOrWhiteSpace(guid) || string.IsNullOrWhiteSpace(state) || !Request.Cookies.ContainsKey("bookmark"))
|
if (state == "unwatched")
|
||||||
return;
|
UserData.Remove(existing);
|
||||||
|
else
|
||||||
using var db = new Database.DbConn();
|
existing.State = state;
|
||||||
var existing = db.States.FirstOrDefault(p => p.TalkId == guid && p.UserId == userid);
|
else
|
||||||
if (existing != null)
|
UserData.Add(new UserStatus(userid, guid, state));
|
||||||
if (state == "unwatched") {
|
WriteUserData();
|
||||||
db.States.Delete(p => p == existing);
|
Response.Redirect("/");
|
||||||
}
|
}
|
||||||
else {
|
}
|
||||||
existing.State = state;
|
|
||||||
db.Update(existing);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
db.Insert(new States { State = state, TalkId = guid, UserId = userid });
|
|
||||||
|
|
||||||
Response.Redirect("/");
|
public static void ReadUserData() {
|
||||||
|
lock (c3stream.Lock)
|
||||||
|
UserData = JsonConvert.DeserializeObject<List<UserStatus>>(System.IO.File.ReadAllText(c3stream.DbPath));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void WriteUserData() {
|
||||||
|
lock (c3stream.Lock)
|
||||||
|
System.IO.File.WriteAllText(c3stream.DbPath, JsonConvert.SerializeObject(UserData));
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UserStatus {
|
||||||
|
public readonly string TalkId;
|
||||||
|
public readonly string UserId;
|
||||||
|
public string State;
|
||||||
|
|
||||||
|
public UserStatus(string userId, string talkId, string state = "unwatched") {
|
||||||
|
UserId = userId;
|
||||||
|
State = state;
|
||||||
|
TalkId = talkId;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,25 +1,25 @@
|
||||||
@page
|
@page
|
||||||
@model ErrorModel
|
@model ErrorModel
|
||||||
@{
|
@{
|
||||||
ViewData["Title"] = "Error";
|
ViewData["Title"] = "Error";
|
||||||
}
|
}
|
||||||
|
|
||||||
<h1 class="text-danger">Error.</h1>
|
<h1 class="text-danger">Error.</h1>
|
||||||
<h2 class="text-danger">An error occurred while processing your request.</h2>
|
<h2 class="text-danger">An error occurred while processing your request.</h2>
|
||||||
|
|
||||||
@if (Model.ShowRequestId) {
|
@if (Model.ShowRequestId) {
|
||||||
<p>
|
<p>
|
||||||
<strong>Request ID:</strong> <code>@Model.RequestId</code>
|
<strong>Request ID:</strong> <code>@Model.RequestId</code>
|
||||||
</p>
|
</p>
|
||||||
}
|
}
|
||||||
|
|
||||||
<h3>Development Mode</h3>
|
<h3>Development Mode</h3>
|
||||||
<p>
|
<p>
|
||||||
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
|
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
|
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
|
||||||
It can result in displaying sensitive information from exceptions to end users.
|
It can result in displaying sensitive information from exceptions to end users.
|
||||||
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
|
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
|
||||||
and restarting the app.
|
and restarting the app.
|
||||||
</p>
|
</p>
|
|
@ -3,19 +3,19 @@ using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace c3stream.Pages;
|
namespace c3stream.Pages {
|
||||||
|
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||||
|
public class ErrorModel : PageModel {
|
||||||
|
private readonly ILogger<ErrorModel> _logger;
|
||||||
|
|
||||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
public ErrorModel(ILogger<ErrorModel> logger) => _logger = logger;
|
||||||
public class ErrorModel : PageModel {
|
|
||||||
private readonly ILogger<ErrorModel> _logger;
|
|
||||||
|
|
||||||
public ErrorModel(ILogger<ErrorModel> logger) => _logger = logger;
|
public string RequestId { get; set; }
|
||||||
|
|
||||||
public string RequestId { get; set; }
|
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||||
|
|
||||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
public void OnGet() {
|
||||||
|
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
|
||||||
public void OnGet() {
|
}
|
||||||
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,22 +1,17 @@
|
||||||
@page
|
@page
|
||||||
@using global::c3stream.DataModels
|
|
||||||
@model IndexModel
|
@model IndexModel
|
||||||
@{
|
@{
|
||||||
ViewData["Title"] = "Home";
|
ViewData["Title"] = "Home";
|
||||||
var cookie = c3stream.UpdateCookie(Request, Response, "/");
|
c3stream.UpdateCookie(Request, Response, "/");
|
||||||
var marked = new Database.DbConn().States.Any(p => p.UserId == cookie && p.State == "marked");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<div style="text-align: center">
|
<div style="text-align: center">
|
||||||
<h1>Welcome to c3stream!</h1>
|
<h1>Welcome to c3stream!</h1>
|
||||||
Your bookmark link:<br/>
|
Your bookmark link:<br/>
|
||||||
<code onclick="copyToClipboard(this)">https://@Request.Host.Value?bookmark=@cookie</code><br/><br/>
|
<code onclick="copyToClipboard(this)">https://@Request.Host.Value?bookmark=@Request.Cookies["bookmark"]</code><br/><br/>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
@if (marked) {
|
@foreach (var conf in c3stream.Conferences) {
|
||||||
<a role="button" class="btn btn-primary" href="/Watchlist">watchlist</a>
|
<a role="button" class="btn btn-primary" href="/Conference?c=@conf.Acronym">@conf.Acronym</a>
|
||||||
}
|
}
|
||||||
@foreach (var conf in c3stream.Conferences) {
|
</div>
|
||||||
<a role="button" class="btn btn-primary" href="/Conference?c=@conf.Acronym">@conf.Acronym</a>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
|
@ -1,12 +1,12 @@
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace c3stream.Pages;
|
namespace c3stream.Pages {
|
||||||
|
public class IndexModel : PageModel {
|
||||||
|
private readonly ILogger<IndexModel> _logger;
|
||||||
|
|
||||||
public class IndexModel : PageModel {
|
public IndexModel(ILogger<IndexModel> logger) => _logger = logger;
|
||||||
private readonly ILogger<IndexModel> _logger;
|
|
||||||
|
|
||||||
public IndexModel(ILogger<IndexModel> logger) => _logger = logger;
|
public void OnGet() { }
|
||||||
|
}
|
||||||
public void OnGet() { }
|
|
||||||
}
|
}
|
|
@ -1,123 +1,114 @@
|
||||||
@page
|
@page
|
||||||
@using global::c3stream.DataModels
|
|
||||||
@using System.Net.Http
|
|
||||||
@using System.Net
|
|
||||||
@using System.IO
|
|
||||||
@model InfoModel
|
@model InfoModel
|
||||||
@{
|
@{
|
||||||
ViewData["Title"] = "Info";
|
ViewData["Title"] = "Info";
|
||||||
}
|
}
|
||||||
@{
|
@{
|
||||||
if (string.IsNullOrWhiteSpace(Request.Query["guid"]) || c3stream.GetEventByGuid(Request.Query["guid"]) == null) {
|
if (string.IsNullOrWhiteSpace(Request.Query["guid"]) || c3stream.GetEventByGuid(Request.Query["guid"]) == null) {
|
||||||
Response.Redirect("/");
|
Response.Redirect("/");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var cookie = c3stream.UpdateCookie(Request, Response, $"/Info?guid={Request.Query["guid"]}");
|
c3stream.UpdateCookie(Request, Response, $"/Info?guid={Request.Query["guid"]}");
|
||||||
|
|
||||||
await using var db = new Database.DbConn();
|
ConferenceModel.ReadUserData();
|
||||||
|
var talk = c3stream.GetEventByGuid(Request.Query["guid"]);
|
||||||
|
var state = ConferenceModel.UserData.FirstOrDefault(p => p.TalkId == Request.Query["guid"] && p.UserId == Request.Cookies["bookmark"])?.State;
|
||||||
|
if (talk == null) {
|
||||||
|
Response.Redirect("/");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (state == null) {
|
||||||
|
state = "unwatched";
|
||||||
|
}
|
||||||
|
|
||||||
var talk = c3stream.GetEventByGuid(Request.Query["guid"]);
|
var title = talk.Title;
|
||||||
var state = db.States.FirstOrDefault(p => p.TalkId == Request.Query["guid"].ToString() && p.UserId == cookie)?.State;
|
var speakers = talk.Persons.Any() ? talk.Persons.Aggregate((s, s1) => $"{s}, {s1}") : "<no speakers>";
|
||||||
if (talk == null) {
|
var description = talk.Description;
|
||||||
Response.Redirect("/");
|
if (string.IsNullOrEmpty(description)) {
|
||||||
return;
|
description = "<missing description>";
|
||||||
}
|
}
|
||||||
if (state == null) {
|
|
||||||
state = "unwatched";
|
|
||||||
}
|
|
||||||
|
|
||||||
var title = talk.Title;
|
var isWatched = state == "watched";
|
||||||
var speakers = talk.Persons.Any() ? talk.Persons.Aggregate((s, s1) => $"{s}, {s1}") : "<no speakers>";
|
var isMarked = state == "marked";
|
||||||
var description = talk.Description;
|
var file = $"{talk.Slug}.mp4";
|
||||||
if (string.IsNullOrEmpty(description)) {
|
var conference = c3stream.GetConferenceByEventGuid(talk.Guid);
|
||||||
description = "<missing description>";
|
|
||||||
}
|
|
||||||
|
|
||||||
var isWatched = state == "watched";
|
var eventName = talk.Tags.Count <= 1 ? conference.Acronym : talk.Tags[0];
|
||||||
var isMarked = state == "marked";
|
var logoPath = System.IO.Path.Combine(c3stream.CachePath, conference.Acronym, "logo.png");
|
||||||
var file = $"{talk.Slug}.mp4";
|
|
||||||
var conference = c3stream.GetConferenceByEventGuid(talk.Guid);
|
|
||||||
|
|
||||||
var eventName = talk.Tags.Count <= 1 ? conference.Acronym : talk.Tags[0];
|
var category = talk.Tags.Count switch {
|
||||||
var logoPath = System.IO.Path.Combine(c3stream.LogoPath, conference.Acronym + ".png");
|
0 => "<no category>",
|
||||||
|
1 => talk.Tags[0],
|
||||||
var category = talk.Tags.Count switch {
|
2 => "<no category>",
|
||||||
0 => "<no category>",
|
3 => talk.Tags[2],
|
||||||
1 => talk.Tags[0],
|
4 => talk.Tags[3],
|
||||||
2 => "<no category>",
|
5 => talk.Tags[3],
|
||||||
3 => talk.Tags[2],
|
_ => "<unknown tag format>"
|
||||||
4 => talk.Tags[3],
|
};
|
||||||
5 => talk.Tags[3],
|
|
||||||
6 => talk.Tags[3],
|
|
||||||
7 => talk.Tags[3],
|
|
||||||
_ => "<unknown tag format>"
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (!System.IO.File.Exists(logoPath)) {
|
@if (System.IO.File.Exists(logoPath)) {
|
||||||
using var httpClient = new HttpClient();
|
<img src="@(c3stream.CacheUrl + $"{conference.Acronym}/logo.png")" alt="Conference logo" style="max-height: 110px; float: right;"/>
|
||||||
await using var stream = httpClient.GetStreamAsync(conference.LogoUri).Result;
|
|
||||||
await using var fileStream = new FileStream(logoPath, FileMode.CreateNew);
|
|
||||||
await stream.CopyToAsync(fileStream);
|
|
||||||
}
|
|
||||||
|
|
||||||
<img src="@(c3stream.LogoUrl + $"{conference.Acronym}.png")" alt="Conference logo" style="max-height: 110px; float: right;"/>
|
|
||||||
|
|
||||||
@if (isWatched) {
|
|
||||||
<h3 style="color: #95cb7a">@title - <i>@speakers</i></h3>
|
|
||||||
}
|
|
||||||
else if (isMarked) {
|
|
||||||
<h3 style="color: #da7d4f">@title - <i>@speakers</i></h3>
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
<h3>@title - <i>@speakers</i></h3>
|
<img src="@conference.LogoUri" alt="Conference logo" style="max-height: 110px; float: right;"/>
|
||||||
|
}
|
||||||
|
|
||||||
|
@if (isWatched) {
|
||||||
|
<h3 style="color: #95cb7a">@title - <i>@speakers</i></h3>
|
||||||
|
}
|
||||||
|
else if (isMarked) {
|
||||||
|
<h3 style="color: #da7d4f">@title - <i>@speakers</i></h3>
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
<h3>@title - <i>@speakers</i></h3>
|
||||||
}
|
}
|
||||||
|
|
||||||
<h5>@eventName - @category - @talk.Date?.Date.ToShortDateString()</h5>
|
<h5>@eventName - @category - @talk.Date?.Date.ToShortDateString()</h5>
|
||||||
<div class="btn-group" role="group" style="margin-bottom: 10px">
|
<div class="btn-group" role="group" style="margin-bottom: 10px">
|
||||||
<a href="@talk.FrontendLink.AbsoluteUri" role="button" class="btn btn-primary btn-c3saction w-100" data-toggle="tooltip" data-placement="right" title="Play">
|
<a href="@talk.FrontendLink.AbsoluteUri" role="button" class="btn btn-primary w-100" data-toggle="tooltip" data-placement="right" title="Play">
|
||||||
<i class="fas fa-play-circle"></i>
|
<i class="fas fa-play-circle"></i>
|
||||||
</a>
|
</a>
|
||||||
@if (System.IO.File.Exists(System.IO.Path.Combine(c3stream.CachePath, conference.Acronym, file))) {
|
@if (System.IO.File.Exists(System.IO.Path.Combine(c3stream.CachePath, conference.Acronym, file))) {
|
||||||
<a href="@(c3stream.CacheUrl + $"{conference.Acronym}/{file}")" role="button" class="btn btn-primary btn-c3saction w-100" data-toggle="tooltip" data-placement="right" title="Mirror">
|
<a href="@(c3stream.CacheUrl + $"{conference.Acronym}/{file}")" role="button" class="btn btn-primary w-100" data-toggle="tooltip" data-placement="right" title="Mirror">
|
||||||
<i class="fas fa-cloud-download"></i>
|
<i class="fas fa-cloud-download"></i>
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
<a href="/" role="button" class="btn btn-primary btn-c3saction disabled">
|
<a href="/" role="button" class="btn btn-primary disabled">
|
||||||
<i class="fas fa-cloud-download"></i>
|
<i class="fas fa-cloud-download"></i>
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
@if (isWatched) {
|
@if (isWatched) {
|
||||||
<button onclick="SetState('@talk.Guid', 'unwatched')" class="btn btn-primary btn-c3saction w-100" data-toggle="tooltip" data-placement="left" title="Mark unwatched">
|
<button onclick="SetState('@talk.Guid', 'unwatched')" class="btn btn-primary w-100" data-toggle="tooltip" data-placement="left" title="Mark unwatched">
|
||||||
<i class="fas fa-times"></i>
|
<i class="fas fa-times"></i>
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-primary btn-c3saction disabled">
|
<button class="btn btn-primary disabled">
|
||||||
<i class="fas fa-clock"></i>
|
<i class="fas fa-clock"></i>
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
else if (isMarked) {
|
else if (isMarked) {
|
||||||
<button onclick="SetState('@talk.Guid', 'watched')" class="btn btn-primary btn-c3saction w-100" data-toggle="tooltip" data-placement="left" title="Mark watched">
|
<button onclick="SetState('@talk.Guid', 'watched')" class="btn btn-primary w-100" data-toggle="tooltip" data-placement="left" title="Mark watched">
|
||||||
<i class="fas fa-check"></i>
|
<i class="fas fa-check"></i>
|
||||||
</button>
|
</button>
|
||||||
<button onclick="SetState('@talk.Guid', 'unwatched')" class="btn btn-primary btn-c3saction w-100" data-toggle="tooltip" data-placement="left" title="Remove from watch later">
|
<button onclick="SetState('@talk.Guid', 'unwatched')" class="btn btn-primary w-100" data-toggle="tooltip" data-placement="left" title="Remove from watch later">
|
||||||
<i class="fas fa-undo-alt"></i>
|
<i class="fas fa-undo-alt"></i>
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
<button onclick="SetState('@talk.Guid', 'watched')" class="btn btn-primary btn-c3saction w-100" data-toggle="tooltip" data-placement="left" title="Mark watched">
|
<button onclick="SetState('@talk.Guid', 'watched')" class="btn btn-primary w-100" data-toggle="tooltip" data-placement="left" title="Mark watched">
|
||||||
<i class="fas fa-check"></i>
|
<i class="fas fa-check"></i>
|
||||||
</button>
|
</button>
|
||||||
<button onclick="SetState('@talk.Guid', 'marked')" class="btn btn-primary btn-c3saction w-100" data-toggle="tooltip" data-placement="left" title="Add to watch later">
|
<button onclick="SetState('@talk.Guid', 'marked')" class="btn btn-primary w-100" data-toggle="tooltip" data-placement="left" title="Add to watch later">
|
||||||
<i class="fas fa-clock"></i>
|
<i class="fas fa-clock"></i>
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p style="text-align: justify">
|
<p style="text-align: justify">
|
||||||
@Html.Raw(description.Replace("\n", "<br/>").Replace("<p>", "").Replace("</p>", ""))
|
@Html.Raw(description.Replace("\n", "<br/>").Replace("<p>", "").Replace("</p>", ""))
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
Share this talk:<br/>
|
Share this talk:<br/>
|
||||||
<code onclick="copyToClipboard(this)">https://@Request.Host.Value/Info?guid=@Request.Query["guid"]</code>
|
<code onclick="copyToClipboard(this)">https://@Request.Host.Value/Info?guid=@Request.Query["guid"]</code>
|
|
@ -1,12 +1,12 @@
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace c3stream.Pages;
|
namespace c3stream.Pages {
|
||||||
|
public class InfoModel : PageModel {
|
||||||
|
private readonly ILogger<InfoModel> _logger;
|
||||||
|
|
||||||
public class InfoModel : PageModel {
|
public InfoModel(ILogger<InfoModel> logger) => _logger = logger;
|
||||||
private readonly ILogger<InfoModel> _logger;
|
|
||||||
|
|
||||||
public InfoModel(ILogger<InfoModel> logger) => _logger = logger;
|
public void OnGet() { }
|
||||||
|
}
|
||||||
public void OnGet() { }
|
|
||||||
}
|
}
|
|
@ -1,28 +1,11 @@
|
||||||
@page
|
@page
|
||||||
@model PrivacyModel
|
@model PrivacyModel
|
||||||
@{
|
@{
|
||||||
ViewData["Title"] = "Privacy";
|
ViewData["Title"] = "Privacy";
|
||||||
}
|
}
|
||||||
<h3>Privacy Policy</h3>
|
<h3>Privacy</h3>
|
||||||
<p style="text-align: justify">
|
<p style="text-align: justify">
|
||||||
Last update: 2022-12-15 <br/><br/>
|
All data saved about you on this website is the watched status of talks you marked in association with your randomly generated bookmark UUID.
|
||||||
All data saved about you on this website is the watched status of talks you marked in association with your randomly generated bookmark UUID. <br/>
|
No logs are kept, no trackers used. Keep in mind that you are forwarded to media.ccc.de when you watch a talk, and therefore should check their privacy policy as well. <br/>
|
||||||
No unnecessary logs are kept, no trackers used. <br/>
|
Have fun!
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>Web server access logs are enabled for statistical purposes only. The following data is collected and kept in anonymized form for a maximum of 28 days:</p>
|
|
||||||
<ul>
|
|
||||||
<li>Request date & time</li>
|
|
||||||
<li>Anonymized IP address (first 48 bits of the IPv6 address, IPv4 addresses go through a NAT46 gateway and are not logged)</li>
|
|
||||||
<li>Request type, URL and protocol</li>
|
|
||||||
<li>HTTP response code</li>
|
|
||||||
<li>Response body size</li>
|
|
||||||
<li>Referer</li>
|
|
||||||
<li>User agent</li>
|
|
||||||
<li>Response time</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<p style="text-align: justify">
|
|
||||||
Keep in mind that you are forwarded to media.ccc.de when you watch a talk (except when using our mirror). <br/>
|
|
||||||
You should therefore reference their privacy policy as well. <br/>
|
|
||||||
</p>
|
|
|
@ -1,12 +1,12 @@
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace c3stream.Pages;
|
namespace c3stream.Pages {
|
||||||
|
public class PrivacyModel : PageModel {
|
||||||
|
private readonly ILogger<PrivacyModel> _logger;
|
||||||
|
|
||||||
public class PrivacyModel : PageModel {
|
public PrivacyModel(ILogger<PrivacyModel> logger) => _logger = logger;
|
||||||
private readonly ILogger<PrivacyModel> _logger;
|
|
||||||
|
|
||||||
public PrivacyModel(ILogger<PrivacyModel> logger) => _logger = logger;
|
public void OnGet() { }
|
||||||
|
}
|
||||||
public void OnGet() { }
|
|
||||||
}
|
}
|
|
@ -1,38 +1,38 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||||
<title>@ViewData["Title"] - c3stream</title>
|
<title>@ViewData["Title"] - c3stream</title>
|
||||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css"/>
|
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css"/>
|
||||||
<link rel="stylesheet" href="~/css/fa.css" crossorigin="anonymous">
|
<link rel="stylesheet" href="~/css/fa.css" crossorigin="anonymous">
|
||||||
<link rel="stylesheet" href="~/css/site.css"/>
|
<link rel="stylesheet" href="~/css/site.css"/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
||||||
<div class="container-fluid" style="width: 90%">
|
<div class="container-fluid" style="width: 90%">
|
||||||
<a class="navbar-brand" asp-area="" asp-page="/Index">c3stream <small style="font-size: x-small">v5</small></a>
|
<a class="navbar-brand" asp-area="" asp-page="/Index">c3stream <small style="font-size: x-small">v4</small></a>
|
||||||
<button class="navbar-toggler" role="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
<button class="navbar-toggler" role="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
||||||
aria-expanded="false" aria-label="Toggle navigation">
|
aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
<div class="container-fluid" style="width: 90%">
|
<div class="container-fluid" style="width: 90%">
|
||||||
<main role="main" class="pb-3">
|
<main role="main" class="pb-3">
|
||||||
@RenderBody()
|
@RenderBody()
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer class="border-top footer">
|
<footer class="border-top footer">
|
||||||
<div class="container-fluid" style="width: 90%; text-align: center">
|
<div class="container-fluid" style="width: 90%; text-align: center">
|
||||||
<a href="/Privacy">Privacy</a> -
|
<a href="/Privacy">Privacy</a> -
|
||||||
<a href="mailto:c3stream-contact@zotan.email">Contact</a> -
|
<a href="mailto:c3stream-contact@zotan.pw">Contact</a> -
|
||||||
<a href="https://git.zotan.services/zotan/c3stream/">Source Code</a> -
|
<a href="https://git.zotan.services/zotan/c3stream/">Source Code</a> -
|
||||||
c3stream is not affiliated with media.ccc.de in any way. Mirrored video files display their license in the video, no rights reserved.
|
c3stream is not affiliated with media.ccc.de in any way. Mirrored video files display their license in the video, no rights reserved.
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
||||||
|
@ -41,4 +41,4 @@
|
||||||
|
|
||||||
@RenderSection("Scripts", false)
|
@RenderSection("Scripts", false)
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,110 +0,0 @@
|
||||||
@page
|
|
||||||
@using global::c3stream.DataModels
|
|
||||||
@model WatchlistModel
|
|
||||||
@{
|
|
||||||
var cookie = c3stream.UpdateCookie(Request, Response, "/Watchlist");
|
|
||||||
ViewData["Title"] = "Watchlist";
|
|
||||||
await using var db = new Database.DbConn();
|
|
||||||
var states = db.States.ToList();
|
|
||||||
var marked = db.States.Where(p => p.UserId == cookie && p.State == "marked").Select(p => p.TalkId).ToList();
|
|
||||||
var watchlist = c3stream.GetEventsByGuid(marked);
|
|
||||||
}
|
|
||||||
|
|
||||||
<table class="table">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th scope="col">Conference</th>
|
|
||||||
<th scope="col">Event</th>
|
|
||||||
<th scope="col">
|
|
||||||
@Html.Raw(Request.Query["orderby"] == "published" ? "<a href=\"/Watchlist\">Published" : "<a href=\"/Watchlist?orderby=published\">Date")
|
|
||||||
</th>
|
|
||||||
<th scope="col">Category</th>
|
|
||||||
<th scope="col">Title</th>
|
|
||||||
<th scope="col">Speaker(s)</th>
|
|
||||||
<th scope="col">Lang</th>
|
|
||||||
<th scope="col">Actions</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@foreach (var talk in Request.Query["orderby"] == "published" ? watchlist.OrderByDescending(p => p.ReleaseDate) : watchlist.OrderBy(p => p.Date)) {
|
|
||||||
var state = states.FirstOrDefault(p => p.TalkId == talk.Guid && p.UserId == cookie)?.State;
|
|
||||||
var isWatched = state == "watched";
|
|
||||||
var isMarked = state == "marked";
|
|
||||||
var file = $"{talk.Slug}.mp4";
|
|
||||||
var conference = c3stream.GetConferenceByEventGuid(talk.Guid);
|
|
||||||
var eventName = talk.Tags.Count <= 1 ? conference.Acronym : talk.Tags[0].Replace("-", "-<br/>");
|
|
||||||
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],
|
|
||||||
6 => talk.Tags[3],
|
|
||||||
7 => talk.Tags[3],
|
|
||||||
_ => "<unknown tag format>"
|
|
||||||
};
|
|
||||||
<tr>
|
|
||||||
<td>@Html.Raw(conference.Acronym)</td>
|
|
||||||
<td>@Html.Raw(eventName)</td>
|
|
||||||
<td>@(Request.Query["orderby"] == "published" ? talk.ReleaseDate?.Date.ToShortDateString() : talk.Date?.Date.ToShortDateString())</td>
|
|
||||||
<td>@category</td>
|
|
||||||
@if (isWatched) {
|
|
||||||
<td style="color: #95cb7a">@talk.Title</td>
|
|
||||||
}
|
|
||||||
else if (isMarked) {
|
|
||||||
<td style="color: #da7d4f">@talk.Title</td>
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
<td>@talk.Title</td>
|
|
||||||
}
|
|
||||||
<td>@(talk.Persons.Any() ? talk.Persons.Aggregate((s, s1) => $"{s}, {s1}") : "<no speakers>")</td>
|
|
||||||
<td>@talk.OriginalLanguage</td>
|
|
||||||
<td>
|
|
||||||
<div class="btn-group" role="group">
|
|
||||||
<a href="@talk.FrontendLink.AbsoluteUri" role="button" class="btn btn-primary btn-c3saction w-100" data-toggle="tooltip" data-placement="top" title="Play">
|
|
||||||
<i class="fas fa-play-circle"></i>
|
|
||||||
</a>
|
|
||||||
@if (System.IO.File.Exists(System.IO.Path.Combine(c3stream.CachePath, conference.Acronym, file))) {
|
|
||||||
<a href="@(c3stream.CacheUrl + $"{conference.Acronym}/{file}")" role="button" class="btn btn-primary btn-c3saction w-100" data-toggle="tooltip" data-placement="top" title="Mirror">
|
|
||||||
<i class="fas fa-cloud-download"></i>
|
|
||||||
</a>
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
<a href="/" role="button" class="btn btn-primary btn-c3saction disabled">
|
|
||||||
<i class="fas fa-cloud-download"></i>
|
|
||||||
</a>
|
|
||||||
}
|
|
||||||
<a href="/Info?guid=@talk.Guid" role="button" class="btn btn-primary btn-c3saction w-100" data-toggle="tooltip" data-placement="top" title="Info">
|
|
||||||
<i class="fas fa-info-circle"></i>
|
|
||||||
</a>
|
|
||||||
@if (isWatched) {
|
|
||||||
<button onclick="SetState('@talk.Guid', 'unwatched')" class="btn btn-primary btn-c3saction w-100" data-toggle="tooltip" data-placement="top" title="Mark unwatched">
|
|
||||||
<i class="fas fa-times"></i>
|
|
||||||
</button>
|
|
||||||
<button class="btn btn-primary btn-c3saction disabled">
|
|
||||||
<i class="fas fa-clock"></i>
|
|
||||||
</button>
|
|
||||||
}
|
|
||||||
else if (isMarked) {
|
|
||||||
<button onclick="SetState('@talk.Guid', 'watched')" class="btn btn-primary btn-c3saction w-100" data-toggle="tooltip" data-placement="top" title="Mark watched">
|
|
||||||
<i class="fas fa-check"></i>
|
|
||||||
</button>
|
|
||||||
<button onclick="SetState('@talk.Guid', 'unwatched')" class="btn btn-primary btn-c3saction w-100" data-toggle="tooltip" data-placement="top" title="Remove from watch later">
|
|
||||||
<i class="fas fa-undo-alt"></i>
|
|
||||||
</button>
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
<button onclick="SetState('@talk.Guid', 'watched')" class="btn btn-primary btn-c3saction w-100" data-toggle="tooltip" data-placement="top" title="Mark watched">
|
|
||||||
<i class="fas fa-check"></i>
|
|
||||||
</button>
|
|
||||||
<button onclick="SetState('@talk.Guid', 'marked')" class="btn btn-primary btn-c3saction w-100" data-toggle="tooltip" data-placement="top" title="Add to watch later">
|
|
||||||
<i class="fas fa-clock"></i>
|
|
||||||
</button>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
|
@ -1,37 +0,0 @@
|
||||||
using System.Linq;
|
|
||||||
using c3stream.DataModels;
|
|
||||||
using c3stream.DataModels.Tables;
|
|
||||||
using LinqToDB;
|
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
|
|
||||||
namespace c3stream.Pages;
|
|
||||||
|
|
||||||
public class WatchlistModel : PageModel {
|
|
||||||
private readonly ILogger<ConferenceModel> _logger;
|
|
||||||
|
|
||||||
public WatchlistModel(ILogger<ConferenceModel> logger) => _logger = logger;
|
|
||||||
|
|
||||||
public void OnGet() {
|
|
||||||
var guid = Request.Query["guid"].ToString();
|
|
||||||
var state = Request.Query["state"].ToString();
|
|
||||||
var userid = Request.Cookies["bookmark"];
|
|
||||||
if (string.IsNullOrWhiteSpace(guid) || string.IsNullOrWhiteSpace(state) || !Request.Cookies.ContainsKey("bookmark"))
|
|
||||||
return;
|
|
||||||
|
|
||||||
using var db = new Database.DbConn();
|
|
||||||
var existing = db.States.FirstOrDefault(p => p.TalkId == guid && p.UserId == userid);
|
|
||||||
if (existing != null)
|
|
||||||
if (state == "unwatched") {
|
|
||||||
db.States.Delete(p => p == existing);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
existing.State = state;
|
|
||||||
db.Update(existing);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
db.Insert(new States { State = state, TalkId = guid, UserId = userid });
|
|
||||||
|
|
||||||
Response.Redirect("/");
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,3 +1,3 @@
|
||||||
@{
|
@{
|
||||||
Layout = "_Layout";
|
Layout = "_Layout";
|
||||||
}
|
}
|
|
@ -1,4 +1,12 @@
|
||||||
{
|
{
|
||||||
|
"iisSettings": {
|
||||||
|
"windowsAuthentication": false,
|
||||||
|
"anonymousAuthentication": true,
|
||||||
|
"iisExpress": {
|
||||||
|
"applicationUrl": "http://localhost:37898",
|
||||||
|
"sslPort": 44314
|
||||||
|
}
|
||||||
|
},
|
||||||
"profiles": {
|
"profiles": {
|
||||||
"c3stream": {
|
"c3stream": {
|
||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
c3stream is a small proxy site meant for saving watched status & watch-later-lists for media.ccc.de talks. Test in
|
c3stream is a small proxy site meant for saving watched status & watch-later-lists for media.ccc.de talks. Test in production at https://c3stream.de
|
||||||
production at https://c3stream.de
|
|
40
Startup.cs
40
Startup.cs
|
@ -4,32 +4,32 @@ using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
|
|
||||||
namespace c3stream;
|
namespace c3stream {
|
||||||
|
public class Startup {
|
||||||
|
public Startup(IConfiguration configuration) => Configuration = configuration;
|
||||||
|
|
||||||
public class Startup {
|
public IConfiguration Configuration { get; }
|
||||||
public Startup(IConfiguration configuration) => Configuration = configuration;
|
|
||||||
|
|
||||||
public IConfiguration Configuration { get; }
|
// This method gets called by the runtime. Use this method to add services to the container.
|
||||||
|
public void ConfigureServices(IServiceCollection services) {
|
||||||
|
services.AddRazorPages();
|
||||||
|
}
|
||||||
|
|
||||||
// This method gets called by the runtime. Use this method to add services to the container.
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||||
public void ConfigureServices(IServiceCollection services) {
|
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) {
|
||||||
services.AddRazorPages();
|
if (env.IsDevelopment())
|
||||||
}
|
app.UseDeveloperExceptionPage();
|
||||||
|
else
|
||||||
|
app.UseExceptionHandler("/Error");
|
||||||
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||||
|
|
||||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
app.UseStaticFiles();
|
||||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) {
|
|
||||||
if (env.IsDevelopment())
|
|
||||||
app.UseDeveloperExceptionPage();
|
|
||||||
else
|
|
||||||
app.UseExceptionHandler("/Error");
|
|
||||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
|
||||||
|
|
||||||
app.UseStaticFiles();
|
app.UseRouting();
|
||||||
|
|
||||||
app.UseRouting();
|
app.UseAuthorization();
|
||||||
|
|
||||||
app.UseAuthorization();
|
app.UseEndpoints(endpoints => { endpoints.MapRazorPages(); });
|
||||||
|
}
|
||||||
app.UseEndpoints(endpoints => { endpoints.MapRazorPages(); });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
217
c3stream.cs
217
c3stream.cs
|
@ -2,146 +2,121 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net;
|
||||||
using c3stream.DataModels;
|
using c3stream.Pages;
|
||||||
using LinqToDB.Data;
|
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
|
|
||||||
namespace c3stream;
|
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://c3stream-mirror.zotan.services/";
|
||||||
|
public static object Lock = new object();
|
||||||
|
public static string DbPath = Path.Combine(DataPath, DbFile);
|
||||||
|
|
||||||
public static class c3stream {
|
public static List<ConferenceObject> Conferences = new List<ConferenceObject> {
|
||||||
public const string DataPath = "data";
|
new ConferenceObject("rc3", true),
|
||||||
public const string DbFile = "c3stream.sqlite";
|
new ConferenceObject("36c3"),
|
||||||
public const string LogoPath = "/mnt/nvme-data/c3stream-logos/";
|
new ConferenceObject("camp2019"),
|
||||||
public const string LogoUrl = "https://mirror.c3stream.de/logos/";
|
new ConferenceObject("gpn19"),
|
||||||
public const string CachePath = "/mnt/zfs/storage/archive/Video/congress/";
|
new ConferenceObject("35c3"),
|
||||||
public const string CacheUrl = "https://mirror.c3stream.de/";
|
new ConferenceObject("34c3"),
|
||||||
public static object Lock = new();
|
new ConferenceObject("33c3"),
|
||||||
public static string DbPath = Path.Combine(DataPath, DbFile);
|
new ConferenceObject("32c3"),
|
||||||
|
new ConferenceObject("31c3"),
|
||||||
|
new ConferenceObject("30c3")
|
||||||
|
};
|
||||||
|
|
||||||
public static readonly List<ConferenceObject> Conferences = new() {
|
public static void Main(string[] args) {
|
||||||
new ConferenceObject("37c3", true),
|
if (!Directory.Exists(DataPath))
|
||||||
new ConferenceObject("mrmcd23"),
|
Directory.CreateDirectory(DataPath);
|
||||||
new ConferenceObject("camp2023"),
|
if (!File.Exists(DbPath))
|
||||||
new ConferenceObject("gpn21"),
|
ConferenceModel.WriteUserData();
|
||||||
new ConferenceObject("trans-tech-tent"),
|
|
||||||
new ConferenceObject("jev22"),
|
|
||||||
new ConferenceObject("MCH2022"),
|
|
||||||
new ConferenceObject("gpn20"),
|
|
||||||
new ConferenceObject("rc3-2021"),
|
|
||||||
new ConferenceObject("rc3"),
|
|
||||||
new ConferenceObject("36c3"),
|
|
||||||
new ConferenceObject("camp2019"),
|
|
||||||
new ConferenceObject("gpn19"),
|
|
||||||
new ConferenceObject("35c3"),
|
|
||||||
new ConferenceObject("34c3"),
|
|
||||||
new ConferenceObject("33c3"),
|
|
||||||
new ConferenceObject("32c3"),
|
|
||||||
new ConferenceObject("31c3"),
|
|
||||||
new ConferenceObject("30c3")
|
|
||||||
};
|
|
||||||
|
|
||||||
public static void Main(string[] args) {
|
foreach (var conference in Conferences)
|
||||||
if (!Directory.Exists(DataPath))
|
UpdateConference(conference);
|
||||||
Directory.CreateDirectory(DataPath);
|
|
||||||
if (!File.Exists(DbPath))
|
|
||||||
File.Copy(Path.Combine(DataPath, "database.init.sqlite"), DbPath);
|
|
||||||
|
|
||||||
DataConnection.DefaultSettings = new Database.Settings();
|
if (args.Length != 0) {
|
||||||
Migrations.RunMigrations();
|
if (args[0] == "logo")
|
||||||
|
foreach (var conference in Conferences) {
|
||||||
foreach (var conference in Conferences)
|
Console.WriteLine($"wget {conference.LogoUri} -O {Path.Combine(CachePath, conference.Acronym, "logo.png")}");
|
||||||
UpdateConference(conference);
|
}
|
||||||
|
else if (Conferences.All(p => p.Acronym != args[0]))
|
||||||
if (args.Length != 0) {
|
Console.WriteLine("No matching conference found.");
|
||||||
if (args[0] == "logo")
|
else
|
||||||
foreach (var conference in Conferences)
|
foreach (var talk in Conferences.First(p => p.Acronym == args[0]).Talks)
|
||||||
Console.WriteLine($"wget {conference.LogoUri} -O {Path.Combine(LogoPath, conference.Acronym + ".png")}");
|
Console.WriteLine($"youtube-dl -f \"best[ext = mp4]\" {talk.FrontendLink} -o \"{Path.Combine(CachePath, args[0], talk.Slug)}.mp4\"");
|
||||||
else if (Conferences.All(p => p.Acronym != args[0]))
|
}
|
||||||
Console.WriteLine("No matching conference found.");
|
else {
|
||||||
else
|
CreateHostBuilder(args).Build().Run();
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO: move this to the database as well
|
|
||||||
public static void UpdateConference(ConferenceObject conference) {
|
|
||||||
using var httpc = new HttpClient();
|
|
||||||
|
|
||||||
var jsonpath = Path.Combine(DataPath, conference.Acronym + "_index.json");
|
|
||||||
var json = "";
|
|
||||||
if (!File.Exists(jsonpath)) {
|
|
||||||
json = httpc.GetStringAsync($"https://api.media.ccc.de/public/conferences/{conference.Acronym}").Result;
|
|
||||||
File.WriteAllText(jsonpath, json);
|
|
||||||
}
|
|
||||||
else if (conference.Ongoing) {
|
|
||||||
json = httpc.GetStringAsync($"https://api.media.ccc.de/public/conferences/{conference.Acronym}").Result;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
json = File.ReadAllText(jsonpath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var parsed = Conference.FromJson(json);
|
public static void UpdateConference(ConferenceObject conference) {
|
||||||
lock (Lock) {
|
using var wc = new WebClient();
|
||||||
conference.Talks.Clear();
|
|
||||||
conference.LogoUri = parsed.LogoUrl.AbsoluteUri;
|
|
||||||
conference.Talks.AddRange(parsed.Events);
|
|
||||||
conference.Talks.ForEach(p => p.Guid = p.Guid.Trim());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string UpdateCookie(HttpRequest request, HttpResponse response, string redirectUri) {
|
var jsonpath = Path.Combine(DataPath, conference.Acronym + "_index.json");
|
||||||
var cookie = "";
|
var json = "";
|
||||||
//if new bookmark is in uri
|
if (!File.Exists(jsonpath)) {
|
||||||
if (request.Query.ContainsKey("bookmark") && Guid.TryParseExact(request.Query["bookmark"], "D", out _)) {
|
json = wc.DownloadString($"https://api.media.ccc.de/public/conferences/{conference.Acronym}");
|
||||||
response.Cookies.Append("bookmark", request.Query["bookmark"], new CookieOptions { Expires = DateTimeOffset.MaxValue });
|
File.WriteAllText(jsonpath, json);
|
||||||
cookie = request.Query["bookmark"];
|
}
|
||||||
}
|
else if (conference.Ongoing) {
|
||||||
//if no cookie exists or cookie is invalid
|
json = wc.DownloadString($"https://api.media.ccc.de/public/conferences/{conference.Acronym}");
|
||||||
else if (!request.Cookies.ContainsKey("bookmark") || !Guid.TryParseExact(request.Cookies["bookmark"], "D", out _)) {
|
}
|
||||||
var guid = Guid.NewGuid().ToString();
|
else {
|
||||||
response.Cookies.Append("bookmark", guid, new CookieOptions { Expires = DateTimeOffset.MaxValue });
|
json = File.ReadAllText(jsonpath);
|
||||||
cookie = guid;
|
}
|
||||||
}
|
|
||||||
else {
|
var parsed = Conference.FromJson(json);
|
||||||
cookie = request.Cookies["bookmark"];
|
lock (Lock) {
|
||||||
|
conference.Talks.Clear();
|
||||||
|
conference.LogoUri = parsed.LogoUrl.AbsoluteUri;
|
||||||
|
conference.Talks.AddRange(parsed.Events);
|
||||||
|
conference.Talks.ForEach(p => p.Guid = p.Guid.Trim());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request.Query.ContainsKey("bookmark"))
|
public static void UpdateCookie(HttpRequest request, HttpResponse response, string redirectUri) {
|
||||||
response.Redirect(redirectUri);
|
//if new bookmark is in uri
|
||||||
|
if (request.Query.ContainsKey("bookmark") && Guid.TryParseExact(request.Query["bookmark"], "D", out _)) {
|
||||||
|
response.Cookies.Append("bookmark", request.Query["bookmark"], new CookieOptions {Expires = DateTimeOffset.MaxValue});
|
||||||
|
}
|
||||||
|
//if no cookie exists or cookie is invalid
|
||||||
|
else if (!request.Cookies.ContainsKey("bookmark") || !Guid.TryParseExact(request.Cookies["bookmark"], "D", out _)) {
|
||||||
|
var guid = Guid.NewGuid().ToString();
|
||||||
|
response.Cookies.Append("bookmark", guid, new CookieOptions {Expires = DateTimeOffset.MaxValue});
|
||||||
|
}
|
||||||
|
|
||||||
return cookie;
|
if (request.Query.ContainsKey("bookmark")) {
|
||||||
}
|
response.Redirect(redirectUri);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static Event GetEventByGuid(string guid) {
|
public static Event GetEventByGuid(string guid) {
|
||||||
return Conferences.SelectMany(c => c.Talks.Where(e => e.Guid == guid)).FirstOrDefault();
|
return Conferences.SelectMany(c => c.Talks.Where(talk => talk.Guid.ToString() == guid)).FirstOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IEnumerable<Event> GetEventsByGuid(IEnumerable<string> guids) {
|
public static ConferenceObject GetConferenceByEventGuid(string guid) {
|
||||||
return Conferences.SelectMany(c => c.Talks.Where(e => guids.Contains(e.Guid)));
|
return Conferences.FirstOrDefault(c => c.Talks.Any(t => t.Guid.ToString() == guid));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ConferenceObject GetConferenceByEventGuid(string guid) {
|
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||||
return Conferences.FirstOrDefault(c => c.Talks.Any(t => t.Guid == guid));
|
Host.CreateDefaultBuilder(args).ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); });
|
||||||
}
|
|
||||||
|
|
||||||
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args).ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); });
|
public class ConferenceObject {
|
||||||
|
public string Acronym;
|
||||||
|
public bool Ongoing;
|
||||||
|
public string LogoUri;
|
||||||
|
public List<Event> Talks = new List<Event>();
|
||||||
|
|
||||||
public class ConferenceObject {
|
public ConferenceObject(string acronym, bool ongoing = false) {
|
||||||
public string Acronym;
|
Acronym = acronym;
|
||||||
public string LogoUri;
|
Ongoing = ongoing;
|
||||||
public bool Ongoing;
|
}
|
||||||
public List<Event> Talks = new();
|
|
||||||
|
|
||||||
public ConferenceObject(string acronym, bool ongoing = false) {
|
|
||||||
Acronym = acronym;
|
|
||||||
Ongoing = ongoing;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,43 +1,36 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net70</TargetFramework>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
<Configurations>Release;Debug</Configurations>
|
|
||||||
<Platforms>x64</Platforms>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="linq2db" Version="3.6.0" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
|
||||||
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.115" />
|
|
||||||
<PackageReference Include="System.Data.SQLite.Core.osx.arm64" Version="1.0.117" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<_ContentIncludedByDefault Remove="data\database.json" />
|
<_ContentIncludedByDefault Remove="data\database.json" />
|
||||||
<_ContentIncludedByDefault Remove="data\_c3stream.json" />
|
<_ContentIncludedByDefault Remove="data\_c3stream.json" />
|
||||||
<_ContentIncludedByDefault Remove="data\33c3.json" />
|
<_ContentIncludedByDefault Remove="data\33c3.json" />
|
||||||
<_ContentIncludedByDefault Remove="data\34c3.json" />
|
<_ContentIncludedByDefault Remove="data\34c3.json" />
|
||||||
<_ContentIncludedByDefault Remove="data\35c3.json" />
|
<_ContentIncludedByDefault Remove="data\35c3.json" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Remove="data\**" />
|
<Compile Remove="data\**" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Remove="data\**" />
|
<EmbeddedResource Remove="data\**" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="data\**" />
|
<None Remove="data\**" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Remove="data\**" />
|
<Content Remove="data\**" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="DataModels" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
12
c3stream.sln
12
c3stream.sln
|
@ -4,13 +4,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "c3stream", "c3stream.csproj
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|x64 = Debug|x64
|
Debug|Any CPU = Debug|Any CPU
|
||||||
Release|x64 = Release|x64
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{BC6A24FE-B35F-4F0A-8E8E-221E61E41EEF}.Debug|x64.ActiveCfg = Debug|x64
|
{BC6A24FE-B35F-4F0A-8E8E-221E61E41EEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{BC6A24FE-B35F-4F0A-8E8E-221E61E41EEF}.Debug|x64.Build.0 = Debug|x64
|
{BC6A24FE-B35F-4F0A-8E8E-221E61E41EEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{BC6A24FE-B35F-4F0A-8E8E-221E61E41EEF}.Release|x64.ActiveCfg = Release|x64
|
{BC6A24FE-B35F-4F0A-8E8E-221E61E41EEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{BC6A24FE-B35F-4F0A-8E8E-221E61E41EEF}.Release|x64.Build.0 = Release|x64
|
{BC6A24FE-B35F-4F0A-8E8E-221E61E41EEF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|
Binary file not shown.
|
@ -1,12 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
# Requires jq and sqlite3
|
|
||||||
|
|
||||||
cp database.init.sqlite data/c3stream.sqlite
|
|
||||||
|
|
||||||
rm migration.sql
|
|
||||||
|
|
||||||
for row in $(cat "data/c3stream.user.json" | jq -c '.[]'); do
|
|
||||||
echo "INSERT INTO States (TalkId, UserId, State) VALUES ($(echo $row | jq '.TalkId'),$(echo $row | jq '.UserId'),$(echo $row | jq '.State'));" | tee -a migration.sql
|
|
||||||
done
|
|
||||||
|
|
||||||
cat migration.sql | sqlite3 data/c3stream.sqlite
|
|
BIN
wwwroot/.DS_Store
vendored
BIN
wwwroot/.DS_Store
vendored
Binary file not shown.
|
@ -88,16 +88,13 @@ body {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
border-color: #3c6385;
|
border-color: #3c6385;
|
||||||
background-color: #375a7a;
|
background-color: #375a7a;
|
||||||
}
|
|
||||||
|
|
||||||
.btn-c3saction {
|
|
||||||
width: 42px !important;
|
width: 42px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open > .dropdown-toggle.btn-primary {
|
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open > .dropdown-toggle.btn-primary {
|
||||||
color: #ffffff !important;
|
color: #ffffff;
|
||||||
border-color: #3c6385 !important;
|
border-color: #3c6385;
|
||||||
background-color: #2c5f93 !important;
|
background-color: #2c5f93;
|
||||||
}
|
}
|
||||||
|
|
||||||
.border-top {
|
.border-top {
|
||||||
|
@ -109,5 +106,5 @@ code {
|
||||||
}
|
}
|
||||||
|
|
||||||
.fa-times {
|
.fa-times {
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue