mirror of
https://github.com/truewhile/MeBox.git
synced 2026-11-17 05:04:24 +08:00
优化
This commit is contained in:
@@ -239,26 +239,6 @@ func (s *MediaService) completedMediaIDSet(ctx context.Context, filters MediaLis
|
||||
return out
|
||||
}
|
||||
|
||||
func (s *MediaService) ListRecentSeriesCards(ctx context.Context, limit int, visibility MediaVisibility) ([]SeriesCard, error) {
|
||||
if limit <= 0 {
|
||||
limit = 24
|
||||
} else if limit > 100 {
|
||||
limit = 100
|
||||
}
|
||||
rows, err := s.SearchMediaVisible(ctx, "", maxMediaSearchLimit, visibility)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cards := groupMediaSeriesCards(rows)
|
||||
if len(cards) == 0 {
|
||||
return []SeriesCard{}, nil
|
||||
}
|
||||
if len(cards) > limit {
|
||||
cards = cards[:limit]
|
||||
}
|
||||
return cards, nil
|
||||
}
|
||||
|
||||
func (s *MediaService) ListLibrarySeriesEpisodes(ctx context.Context, libraryID, key string, visibility MediaVisibility) ([]model.Media, error) {
|
||||
rows, err := s.libraryRowsWithIndex(ctx, libraryID, visibility)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user