mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Solving many bugs.
This commit is contained in:
parent
439ff05c21
commit
b3824b3b03
@ -224,6 +224,8 @@ Stream *ExtractSubtitles(const char *path, const char *outPath, int *streamCount
|
|||||||
outputList[i] = NULL;
|
outputList[i] = NULL;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
*subtitleCount += 1;
|
||||||
|
|
||||||
//Get metadata for file name
|
//Get metadata for file name
|
||||||
streams[i] = Stream(NULL, //title
|
streams[i] = Stream(NULL, //title
|
||||||
av_dict_get(inputStream->metadata, "language", NULL, 0)->value, //language
|
av_dict_get(inputStream->metadata, "language", NULL, 0)->value, //language
|
||||||
@ -253,12 +255,15 @@ Stream *ExtractSubtitles(const char *path, const char *outPath, int *streamCount
|
|||||||
outStream << ".srt";
|
outStream << ".srt";
|
||||||
else if (strcmp(streams[i].codec, "ass") == 0)
|
else if (strcmp(streams[i].codec, "ass") == 0)
|
||||||
outStream << ".ass";
|
outStream << ".ass";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::cout << "Unsupported subtitle codec: " << streams[i].codec << std::endl;
|
||||||
|
outputList[i] = NULL;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
streams[i].path = _strdup(outStream.str().c_str());
|
streams[i].path = _strdup(outStream.str().c_str());
|
||||||
|
|
||||||
*subtitleCount += 1;
|
|
||||||
|
|
||||||
std::cout << "Stream #" << i << "(" << streams[i].language << "), stream type: " << inputCodecpar->codec_type << " codec: " << streams[i].codec << std::endl;
|
std::cout << "Stream #" << i << "(" << streams[i].language << "), stream type: " << inputCodecpar->codec_type << " codec: " << streams[i].codec << std::endl;
|
||||||
|
|
||||||
AVFormatContext *outputContext = NULL;
|
AVFormatContext *outputContext = NULL;
|
||||||
@ -293,7 +298,6 @@ Stream *ExtractSubtitles(const char *path, const char *outPath, int *streamCount
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Write subtitle data to files.
|
//Write subtitle data to files.
|
||||||
AVPacket pkt;
|
AVPacket pkt;
|
||||||
while (av_read_frame(inputContext, &pkt) == 0)
|
while (av_read_frame(inputContext, &pkt) == 0)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<div class="container justify-content-center">
|
<div class="container-fluid justify-content-center">
|
||||||
<button mat-icon-button data-toggle="tooltip" data-placement="bottom" title="Filter">
|
<button mat-icon-button data-toggle="tooltip" data-placement="bottom" title="Filter">
|
||||||
<mat-icon>filter_list</mat-icon>
|
<mat-icon>filter_list</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
@ -20,7 +20,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</mat-menu>
|
</mat-menu>
|
||||||
|
|
||||||
<div class="container justify-content-center">
|
<div class="container-fluid justify-content-center">
|
||||||
<a class="show" *ngFor="let show of this.shows" routerLink="/show/{{show.slug}}">
|
<a class="show" *ngFor="let show of this.shows" routerLink="/show/{{show.slug}}">
|
||||||
<img [style.background-image]="getThumb(show.slug)" />
|
<img [style.background-image]="getThumb(show.slug)" />
|
||||||
<p class="title">{{show.title}}</p>
|
<p class="title">{{show.title}}</p>
|
||||||
|
@ -12,7 +12,7 @@ button
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container
|
.container-fluid
|
||||||
{
|
{
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
@ -21,27 +21,34 @@ button
|
|||||||
.show
|
.show
|
||||||
{
|
{
|
||||||
width: 33%;
|
width: 33%;
|
||||||
|
max-width: 200px;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
outline: none;
|
outline: none;
|
||||||
|
|
||||||
@include media-breakpoint-up(md)
|
@include media-breakpoint-up(sm)
|
||||||
{
|
{
|
||||||
width: 25%;
|
width: 25%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include media-breakpoint-up(lg)
|
@include media-breakpoint-up(md)
|
||||||
{
|
{
|
||||||
width: 20%;
|
width: 20%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include media-breakpoint-up(xl)
|
@include media-breakpoint-up(lg)
|
||||||
{
|
{
|
||||||
width: 18%;
|
width: 18%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@include media-breakpoint-up(xl)
|
||||||
|
{
|
||||||
|
width: 15%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
&:focus, &:hover
|
&:focus, &:hover
|
||||||
{
|
{
|
||||||
> img
|
> img
|
||||||
|
@ -13,6 +13,14 @@
|
|||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
{
|
||||||
|
.episodes
|
||||||
|
{
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.episodes
|
.episodes
|
||||||
@ -26,11 +34,6 @@
|
|||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
|
|
||||||
&:hover
|
|
||||||
{
|
|
||||||
visibility: visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
&::-webkit-scrollbar
|
&::-webkit-scrollbar
|
||||||
{
|
{
|
||||||
height: 4px;
|
height: 4px;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
@import "~bootstrap//scss/functions";
|
@import "~bootstrap/scss/functions";
|
||||||
@import "~bootstrap/scss/variables";
|
@import "~bootstrap/scss/variables";
|
||||||
@import "~bootstrap/scss//mixins/breakpoints";
|
@import "~bootstrap/scss/mixins/breakpoints";
|
||||||
|
|
||||||
a
|
a
|
||||||
{
|
{
|
||||||
@ -17,6 +17,7 @@ a
|
|||||||
{
|
{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-height: 75vh;
|
max-height: 75vh;
|
||||||
|
min-height: 60vh;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -748,6 +748,9 @@ namespace Kyoo.InternalAPI
|
|||||||
|
|
||||||
public void RegisterShowPeople(long showID, List<People> people)
|
public void RegisterShowPeople(long showID, List<People> people)
|
||||||
{
|
{
|
||||||
|
if (people == null)
|
||||||
|
return;
|
||||||
|
|
||||||
string linkQuery = "INSERT INTO peopleLinks (peopleID, showID, role, type) VALUES($peopleID, $showID, $role, $type);";
|
string linkQuery = "INSERT INTO peopleLinks (peopleID, showID, role, type) VALUES($peopleID, $showID, $role, $type);";
|
||||||
|
|
||||||
for (int i = 0; i < people.Count; i++)
|
for (int i = 0; i < people.Count; i++)
|
||||||
|
@ -71,7 +71,7 @@ namespace Kyoo.InternalAPI.MetadataProvider.TheTvDB
|
|||||||
|
|
||||||
public long? GetYear(string firstAired)
|
public long? GetYear(string firstAired)
|
||||||
{
|
{
|
||||||
if (long.TryParse(firstAired?.Substring(0, 4), out long year))
|
if (firstAired?.Length >= 4 && long.TryParse(firstAired?.Substring(0, 4), out long year))
|
||||||
return year;
|
return year;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -276,12 +276,12 @@ namespace Kyoo.InternalAPI.MetadataProvider
|
|||||||
string id = GetID(externalIDs);
|
string id = GetID(externalIDs);
|
||||||
|
|
||||||
if (id == null)
|
if (id == null)
|
||||||
return null;
|
return new Episode(seasonNumber, episodeNumber, null, null, null, -1, null, externalIDs);
|
||||||
|
|
||||||
string token = await Authentificate();
|
string token = await Authentificate();
|
||||||
|
|
||||||
if (token == null)
|
if (token == null)
|
||||||
return null;
|
return new Episode(seasonNumber, episodeNumber, null, null, null, -1, null, externalIDs);
|
||||||
|
|
||||||
WebRequest request = WebRequest.Create("https://api.thetvdb.com/series/" + id + "/episodes/query?airedSeason=" + seasonNumber + "&airedEpisode=" + episodeNumber);
|
WebRequest request = WebRequest.Create("https://api.thetvdb.com/series/" + id + "/episodes/query?airedSeason=" + seasonNumber + "&airedEpisode=" + episodeNumber);
|
||||||
request.Method = "GET";
|
request.Method = "GET";
|
||||||
@ -313,13 +313,13 @@ namespace Kyoo.InternalAPI.MetadataProvider
|
|||||||
{
|
{
|
||||||
Debug.WriteLine("&TheTvDB Provider couldn't work for the episode number: " + episodeNumber + ".\nError Code: " + response.StatusCode + " Message: " + response.StatusDescription);
|
Debug.WriteLine("&TheTvDB Provider couldn't work for the episode number: " + episodeNumber + ".\nError Code: " + response.StatusCode + " Message: " + response.StatusDescription);
|
||||||
response.Close();
|
response.Close();
|
||||||
return null;
|
return new Episode(seasonNumber, episodeNumber, null, null, null, -1, null, externalIDs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (WebException ex)
|
catch (WebException ex)
|
||||||
{
|
{
|
||||||
Debug.WriteLine("&TheTvDB Provider couldn't work for the episode number: " + episodeNumber + ".\nError Code: " + ex.Status);
|
Debug.WriteLine("&TheTvDB Provider couldn't work for the episode number: " + episodeNumber + ".\nError Code: " + ex.Status);
|
||||||
return null;
|
return new Episode(seasonNumber, episodeNumber, null, null, null, -1, null, externalIDs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Binary file not shown.
@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"databasePath": "C://Projects/database.db",
|
"databasePath": "C://Projects/database.db",
|
||||||
"tempPath": "C://Projects/temp",
|
"tempPath": "C:\\\\Projects\\temp",
|
||||||
"peoplePath": "D://Videos/People",
|
"peoplePath": "D:\\\\Videos\\People",
|
||||||
"plugins": "C:\\Projects\\Kyoo\\Debug",
|
"plugins": "C:\\Projects\\Kyoo\\Debug",
|
||||||
"providerPlugins": "C://Projects/Plugins/Providers",
|
"providerPlugins": "C://Projects/Plugins/Providers",
|
||||||
"libraryPaths": [
|
"libraryPaths": [
|
||||||
"D:\\Videos"
|
"\\\\sdg\\video\\Anime"
|
||||||
],
|
],
|
||||||
"regex": ".*\\\\(?<ShowTitle>.+?) S(?<Season>\\d+)E(?<Episode>\\d+)"
|
"regex": ".*\\\\(?<ShowTitle>.+?) S(?<Season>\\d+)E(?<Episode>\\d+)"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user