diff --git a/Kyoo.Transcoder/Kyoo.Transcoder.vcxproj b/Kyoo.Transcoder/Kyoo.Transcoder.vcxproj index 4d9f4280..6419e8d4 100644 --- a/Kyoo.Transcoder/Kyoo.Transcoder.vcxproj +++ b/Kyoo.Transcoder/Kyoo.Transcoder.vcxproj @@ -74,10 +74,11 @@ true $(ProjectDir)\ffmpeg\include;$(IncludePath) $(ProjectDir)\ffmpeg\lib;$(LibraryPath) + $(SolutionDir)Kyoo\Transcoder true - $(SolutionDir)$(Configuration)\ + $(SolutionDir)Kyoo\Transcoder $(ProjectDir)\ffmpeg\include;$(IncludePath) $(ProjectDir)\ffmpeg\lib;$(LibraryPath) @@ -85,10 +86,11 @@ false $(ProjectDir)\ffmpeg\include;$(IncludePath) $(ProjectDir)\ffmpeg\lib;$(LibraryPath) + $(SolutionDir)Kyoo\Transcoder false - $(SolutionDir)$(Configuration)\ + $(SolutionDir)Kyoo\Transcoder $(ProjectDir)\ffmpeg\include;$(IncludePath) $(ProjectDir)\ffmpeg\lib;$(LibraryPath) diff --git a/Kyoo.sln b/Kyoo.sln index 36af1c75..39241918 100644 --- a/Kyoo.sln +++ b/Kyoo.sln @@ -4,6 +4,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 VisualStudioVersion = 16.0.29123.88 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kyoo", "Kyoo\Kyoo.csproj", "{0F8275B6-C7DD-42DF-A168-755C81B1C329}" + ProjectSection(ProjectDependencies) = postProject + {E5EFA4B2-F09D-4C4F-83DD-A436CD60BB77} = {E5EFA4B2-F09D-4C4F-83DD-A436CD60BB77} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Kyoo.Transcoder", "Kyoo.Transcoder\Kyoo.Transcoder.vcxproj", "{E5EFA4B2-F09D-4C4F-83DD-A436CD60BB77}" EndProject diff --git a/Kyoo/ClientApp/src/app/episodes-list/episodes-list.component.html b/Kyoo/ClientApp/src/app/episodes-list/episodes-list.component.html index 63648da9..11480529 100644 --- a/Kyoo/ClientApp/src/app/episodes-list/episodes-list.component.html +++ b/Kyoo/ClientApp/src/app/episodes-list/episodes-list.component.html @@ -1,7 +1,7 @@
-
+
S{{episode.seasonNumber}}:E{{episode.episodeNumber}} - {{episode.title}}
diff --git a/Kyoo/ClientApp/src/models/episode.ts b/Kyoo/ClientApp/src/models/episode.ts index 64093ab3..bbe1f5aa 100644 --- a/Kyoo/ClientApp/src/models/episode.ts +++ b/Kyoo/ClientApp/src/models/episode.ts @@ -1,11 +1,12 @@ export interface Episode { + seasonNumber: number; episodeNumber: number; title: string; thumb: string; link: string; overview: string; releaseDate; - runtimeInMinutes: number; + runtime: number; externalIDs: string; } diff --git a/Kyoo/ClientApp/src/models/genre.js b/Kyoo/ClientApp/src/models/genre.js new file mode 100644 index 00000000..42d8ea30 --- /dev/null +++ b/Kyoo/ClientApp/src/models/genre.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=genre.js.map \ No newline at end of file diff --git a/Kyoo/ClientApp/src/models/genre.js.map b/Kyoo/ClientApp/src/models/genre.js.map new file mode 100644 index 00000000..4ab106f3 --- /dev/null +++ b/Kyoo/ClientApp/src/models/genre.js.map @@ -0,0 +1 @@ +{"version":3,"file":"genre.js","sourceRoot":"","sources":["genre.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/Kyoo/ClientApp/src/models/genre.ts b/Kyoo/ClientApp/src/models/genre.ts new file mode 100644 index 00000000..51fd90fb --- /dev/null +++ b/Kyoo/ClientApp/src/models/genre.ts @@ -0,0 +1,5 @@ +export interface Genre +{ + slug: string; + name: string; +} diff --git a/Kyoo/ClientApp/src/models/people.js b/Kyoo/ClientApp/src/models/people.js new file mode 100644 index 00000000..03aaf773 --- /dev/null +++ b/Kyoo/ClientApp/src/models/people.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=people.js.map \ No newline at end of file diff --git a/Kyoo/ClientApp/src/models/people.js.map b/Kyoo/ClientApp/src/models/people.js.map new file mode 100644 index 00000000..8e8b5254 --- /dev/null +++ b/Kyoo/ClientApp/src/models/people.js.map @@ -0,0 +1 @@ +{"version":3,"file":"people.js","sourceRoot":"","sources":["people.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/Kyoo/ClientApp/src/models/people.ts b/Kyoo/ClientApp/src/models/people.ts new file mode 100644 index 00000000..58339f7c --- /dev/null +++ b/Kyoo/ClientApp/src/models/people.ts @@ -0,0 +1,9 @@ +export interface People +{ + slug: string; + name: string; + role: string; + type: string; + + externalIDs: string; +} diff --git a/Kyoo/ClientApp/src/models/show.ts b/Kyoo/ClientApp/src/models/show.ts index 9e168862..be30cdb5 100644 --- a/Kyoo/ClientApp/src/models/show.ts +++ b/Kyoo/ClientApp/src/models/show.ts @@ -1,26 +1,25 @@ import { Season } from "./season"; +import { Genre } from "./genre"; +import { People } from "./people"; +import { Studio } from "./studio"; export interface Show { - id: number; slug: string; title: string; - //IEnumerable < > Aliases; - path: string; + Aliases: string[]; overview: string; - trailer: string; - //IEnumerable < > Genres; - //Status ? Status; + genres: Genre[]; + status: string; + studio: Studio; + directors: People[]; + people: People[]; + seasons: Season[]; + trailerUrl: string; startYear: number; endYear : number; - imgPrimary: string; - imgThumb: string; - imgLogo: string; - imgBackdrop: string; - externalIDs: string; - seasons: Season[]; } diff --git a/Kyoo/ClientApp/src/models/studio.js b/Kyoo/ClientApp/src/models/studio.js new file mode 100644 index 00000000..29ec1c75 --- /dev/null +++ b/Kyoo/ClientApp/src/models/studio.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=studio.js.map \ No newline at end of file diff --git a/Kyoo/ClientApp/src/models/studio.js.map b/Kyoo/ClientApp/src/models/studio.js.map new file mode 100644 index 00000000..4708033d --- /dev/null +++ b/Kyoo/ClientApp/src/models/studio.js.map @@ -0,0 +1 @@ +{"version":3,"file":"studio.js","sourceRoot":"","sources":["studio.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/Kyoo/ClientApp/src/models/studio.ts b/Kyoo/ClientApp/src/models/studio.ts new file mode 100644 index 00000000..6c0d63ee --- /dev/null +++ b/Kyoo/ClientApp/src/models/studio.ts @@ -0,0 +1,5 @@ +export interface Studio +{ + slug: string; + name: string; +} diff --git a/Kyoo/ClientApp/src/models/watch-item.ts b/Kyoo/ClientApp/src/models/watch-item.ts index 68b8e020..d2256e7c 100644 --- a/Kyoo/ClientApp/src/models/watch-item.ts +++ b/Kyoo/ClientApp/src/models/watch-item.ts @@ -15,7 +15,7 @@ export interface WatchItem previousEpisode: string; nextEpisode: Episode; - audio: Track[]; + audios: Track[]; subtitles: Track[]; } diff --git a/Kyoo/InternalAPI/LibraryManager/LibraryManager.cs b/Kyoo/InternalAPI/LibraryManager/LibraryManager.cs index 2fa9fe0a..93c30cb9 100644 --- a/Kyoo/InternalAPI/LibraryManager/LibraryManager.cs +++ b/Kyoo/InternalAPI/LibraryManager/LibraryManager.cs @@ -613,6 +613,27 @@ namespace Kyoo.InternalAPI return (long)cmd.ExecuteScalar(); } } + + public long GetOrCreatePeople(People people) + { + People existingPeople = GetPeopleBySlug(people.slug); + + if (existingPeople != null) + return existingPeople.id; + + string query = "INSERT INTO people (slug, name, imgPrimary, externalIDs) VALUES($slug, $name, $imgPrimary, $externalIDs);"; + using (SQLiteCommand cmd = new SQLiteCommand(query, sqlConnection)) + { + cmd.Parameters.AddWithValue("$slug", people.slug); + cmd.Parameters.AddWithValue("$name", people.Name); + cmd.Parameters.AddWithValue("$imgPrimary", people.imgPrimary); + cmd.Parameters.AddWithValue("$externalIDs", people.externalIDs); + cmd.ExecuteNonQuery(); + + cmd.CommandText = "SELECT LAST_INSERT_ROWID()"; + return (long)cmd.ExecuteScalar(); + } + } #endregion #region Write Into The Database @@ -724,28 +745,13 @@ namespace Kyoo.InternalAPI public void RegisterShowPeople(long showID, List people) { - string query = "INSERT INTO people (slug, name, imgPrimary, externalIDs) VALUES($slug, $name, $imgPrimary, $externalIDs);"; string linkQuery = "INSERT INTO peopleLinks (peopleID, showID, role, type) VALUES($peopleID, $showID, $role, $type);"; for (int i = 0; i < people.Count; i++) { - long peopleID; - - using (SQLiteCommand cmd = new SQLiteCommand(query, sqlConnection)) - { - cmd.Parameters.AddWithValue("$slug", people[i].slug); - cmd.Parameters.AddWithValue("$name", people[i].Name); - cmd.Parameters.AddWithValue("$imgPrimary", people[i].imgPrimary); - cmd.Parameters.AddWithValue("$externalIDs", people[i].externalIDs); - cmd.ExecuteNonQuery(); - - cmd.CommandText = "SELECT LAST_INSERT_ROWID()"; - peopleID = (long)cmd.ExecuteScalar(); - } - using (SQLiteCommand cmd = new SQLiteCommand(linkQuery, sqlConnection)) { - cmd.Parameters.AddWithValue("$peopleID", peopleID); + cmd.Parameters.AddWithValue("$peopleID", GetOrCreatePeople(people[i])); cmd.Parameters.AddWithValue("$showID", showID); cmd.Parameters.AddWithValue("$role", people[i].Role); cmd.Parameters.AddWithValue("$type", people[i].Type); diff --git a/Kyoo/InternalAPI/Transcoder/TranscoderAPI.cs b/Kyoo/InternalAPI/Transcoder/TranscoderAPI.cs index 25de79c4..0d1e8e4f 100644 --- a/Kyoo/InternalAPI/Transcoder/TranscoderAPI.cs +++ b/Kyoo/InternalAPI/Transcoder/TranscoderAPI.cs @@ -8,7 +8,7 @@ namespace Kyoo.InternalAPI.TranscoderLink { public class TranscoderAPI { - private const string TranscoderPath = @"C:\Projects\Kyoo\Debug\Kyoo.Transcoder.dll"; + private const string TranscoderPath = @"Transcoder\Kyoo.Transcoder.dll"; [DllImport(TranscoderPath, CallingConvention = CallingConvention.Cdecl)] public extern static int Init(); @@ -42,15 +42,13 @@ namespace Kyoo.InternalAPI.TranscoderLink j++; } streamsPtr += size; - - Debug.WriteLine("&Stream got: " + stream.Language); } } else tracks = null; FreeMemory(ptr); - Debug.WriteLine("&File done: " + path); + Debug.WriteLine("&" + tracks?.Length + " tracks got at: " + path); } [DllImport(TranscoderPath, CallingConvention = CallingConvention.Cdecl)] diff --git a/Kyoo/Kyoo.csproj b/Kyoo/Kyoo.csproj index f73240a9..5479cc8b 100644 --- a/Kyoo/Kyoo.csproj +++ b/Kyoo/Kyoo.csproj @@ -33,7 +33,10 @@ + + + @@ -72,10 +75,55 @@ + + + + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + diff --git a/Kyoo/Models/Show.cs b/Kyoo/Models/Show.cs index b74287d0..2475022c 100644 --- a/Kyoo/Models/Show.cs +++ b/Kyoo/Models/Show.cs @@ -31,8 +31,8 @@ namespace Kyoo.Models //Used in the rest API excusively. public Studio studio; public IEnumerable directors; - public IEnumerable seasons; public IEnumerable people; + public IEnumerable seasons; public string GetAliases() diff --git a/Kyoo/Transcoder/Kyoo.Transcoder.dll b/Kyoo/Transcoder/Kyoo.Transcoder.dll new file mode 100644 index 00000000..e29ec11e Binary files /dev/null and b/Kyoo/Transcoder/Kyoo.Transcoder.dll differ diff --git a/Kyoo/Transcoder/Kyoo.Transcoder.exp b/Kyoo/Transcoder/Kyoo.Transcoder.exp new file mode 100644 index 00000000..7c3be9c1 Binary files /dev/null and b/Kyoo/Transcoder/Kyoo.Transcoder.exp differ diff --git a/Kyoo/Transcoder/Kyoo.Transcoder.lib b/Kyoo/Transcoder/Kyoo.Transcoder.lib new file mode 100644 index 00000000..c5ce290a Binary files /dev/null and b/Kyoo/Transcoder/Kyoo.Transcoder.lib differ diff --git a/Kyoo/Transcoder/avcodec-58.dll b/Kyoo/Transcoder/avcodec-58.dll new file mode 100644 index 00000000..8cfb4809 Binary files /dev/null and b/Kyoo/Transcoder/avcodec-58.dll differ diff --git a/Kyoo/Transcoder/avdevice-58.dll b/Kyoo/Transcoder/avdevice-58.dll new file mode 100644 index 00000000..ae71dbbe Binary files /dev/null and b/Kyoo/Transcoder/avdevice-58.dll differ diff --git a/Kyoo/Transcoder/avfilter-7.dll b/Kyoo/Transcoder/avfilter-7.dll new file mode 100644 index 00000000..e97bf312 Binary files /dev/null and b/Kyoo/Transcoder/avfilter-7.dll differ diff --git a/Kyoo/Transcoder/avformat-58.dll b/Kyoo/Transcoder/avformat-58.dll new file mode 100644 index 00000000..c5dbcc1a Binary files /dev/null and b/Kyoo/Transcoder/avformat-58.dll differ diff --git a/Kyoo/Transcoder/avutil-56.dll b/Kyoo/Transcoder/avutil-56.dll new file mode 100644 index 00000000..00c3032e Binary files /dev/null and b/Kyoo/Transcoder/avutil-56.dll differ diff --git a/Kyoo/Transcoder/postproc-55.dll b/Kyoo/Transcoder/postproc-55.dll new file mode 100644 index 00000000..6022ecff Binary files /dev/null and b/Kyoo/Transcoder/postproc-55.dll differ diff --git a/Kyoo/Transcoder/swresample-3.dll b/Kyoo/Transcoder/swresample-3.dll new file mode 100644 index 00000000..d7dad19a Binary files /dev/null and b/Kyoo/Transcoder/swresample-3.dll differ diff --git a/Kyoo/Transcoder/swscale-5.dll b/Kyoo/Transcoder/swscale-5.dll new file mode 100644 index 00000000..11a1ee82 Binary files /dev/null and b/Kyoo/Transcoder/swscale-5.dll differ