Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
OnlyFart committed Oct 30, 2024
1 parent 2a04129 commit e430f7a
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions Core/Logic/Getters/BooksYandex/BooksYandexBooksGetter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Net;
Expand All @@ -19,22 +18,13 @@ namespace Core.Logic.Getters.BooksYandex;
public class BooksYandexBooksGetter : BooksYandexGetterBase {
public BooksYandexBooksGetter(BookGetterConfig config) : base(config) { }

protected override string[] Paths => ["books", "audio", "serials"];
protected override string[] Paths => ["books", "audiobooks", "serials"];

protected override async Task<IEnumerable<Chapter>> FillChapters(Book book, BooksYandexResponse response) {
var id = response.Book?.UUID ?? response.AudioBook?.LinkedBooks?.FirstOrDefault();
if (string.IsNullOrWhiteSpace(id)) {
return [];
}

if (Config.Options.HasAdditionalType(AdditionalTypeEnum.Audio)) {
book.AdditionalFiles.Add(AdditionalTypeEnum.Audio, await GetAudio(response));
}

return await GetChapters(book, response);
}

private async Task<IEnumerable<Chapter>> GetChapters(Book book, BooksYandexResponse response) {
var id = response.Book?.UUID ?? response.AudioBook?.LinkedBooks?.FirstOrDefault();
if (string.IsNullOrWhiteSpace(id)) {
return [];
Expand Down

0 comments on commit e430f7a

Please sign in to comment.