Solving many bugs.

This commit is contained in:
Zoe Roux 2019-09-30 02:14:34 +02:00
parent 439ff05c21
commit b3824b3b03
10 changed files with 44 additions and 26 deletions

View File

@ -224,6 +224,8 @@ Stream *ExtractSubtitles(const char *path, const char *outPath, int *streamCount
outputList[i] = NULL;
else
{
*subtitleCount += 1;
//Get metadata for file name
streams[i] = Stream(NULL, //title
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";
else if (strcmp(streams[i].codec, "ass") == 0)
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());
*subtitleCount += 1;
std::cout << "Stream #" << i << "(" << streams[i].language << "), stream type: " << inputCodecpar->codec_type << " codec: " << streams[i].codec << std::endl;
AVFormatContext *outputContext = NULL;
@ -293,7 +298,6 @@ Stream *ExtractSubtitles(const char *path, const char *outPath, int *streamCount
}
}
}
//Write subtitle data to files.
AVPacket pkt;
while (av_read_frame(inputContext, &pkt) == 0)

View File

@ -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">
<mat-icon>filter_list</mat-icon>
</button>
@ -20,7 +20,7 @@
</div>
</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}}">
<img [style.background-image]="getThumb(show.slug)" />
<p class="title">{{show.title}}</p>

View File

@ -12,7 +12,7 @@ button
font-size: 12px;
}
.container
.container-fluid
{
display: flex;
flex-wrap: wrap;
@ -21,27 +21,34 @@ button
.show
{
width: 33%;
max-width: 200px;
list-style: none;
padding: 1em;
text-decoration: none;
color: inherit;
outline: none;
@include media-breakpoint-up(md)
@include media-breakpoint-up(sm)
{
width: 25%;
}
@include media-breakpoint-up(lg)
@include media-breakpoint-up(md)
{
width: 20%;
}
@include media-breakpoint-up(xl)
@include media-breakpoint-up(lg)
{
width: 18%;
}
@include media-breakpoint-up(xl)
{
width: 15%;
}
&:focus, &:hover
{
> img

View File

@ -13,6 +13,14 @@
display: block;
}
}
&:hover
{
.episodes
{
visibility: visible;
}
}
}
.episodes
@ -26,11 +34,6 @@
flex-direction: row;
visibility: hidden;
&:hover
{
visibility: visible;
}
&::-webkit-scrollbar
{
height: 4px;

View File

@ -1,6 +1,6 @@
@import "~bootstrap//scss/functions";
@import "~bootstrap/scss/functions";
@import "~bootstrap/scss/variables";
@import "~bootstrap/scss//mixins/breakpoints";
@import "~bootstrap/scss/mixins/breakpoints";
a
{
@ -17,6 +17,7 @@ a
{
width: 100%;
max-height: 75vh;
min-height: 60vh;
object-fit: cover;
}

View File

@ -748,6 +748,9 @@ namespace Kyoo.InternalAPI
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);";
for (int i = 0; i < people.Count; i++)

View File

@ -71,7 +71,7 @@ namespace Kyoo.InternalAPI.MetadataProvider.TheTvDB
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 null;

View File

@ -276,12 +276,12 @@ namespace Kyoo.InternalAPI.MetadataProvider
string id = GetID(externalIDs);
if (id == null)
return null;
return new Episode(seasonNumber, episodeNumber, null, null, null, -1, null, externalIDs);
string token = await Authentificate();
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);
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);
response.Close();
return null;
return new Episode(seasonNumber, episodeNumber, null, null, null, -1, null, externalIDs);
}
}
catch (WebException ex)
{
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.

View File

@ -1,11 +1,11 @@
{
"databasePath": "C://Projects/database.db",
"tempPath": "C://Projects/temp",
"peoplePath": "D://Videos/People",
"tempPath": "C:\\\\Projects\\temp",
"peoplePath": "D:\\\\Videos\\People",
"plugins": "C:\\Projects\\Kyoo\\Debug",
"providerPlugins": "C://Projects/Plugins/Providers",
"libraryPaths": [
"D:\\Videos"
"\\\\sdg\\video\\Anime"
],
"regex": ".*\\\\(?<ShowTitle>.+?) S(?<Season>\\d+)E(?<Episode>\\d+)"
}