File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,6 @@ class LibraryItemController {
49
49
item . episodesDownloading = [ this . podcastManager . currentDownload . toJSONForClient ( ) ]
50
50
}
51
51
}
52
-
53
52
return res . json ( item )
54
53
}
55
54
res . json ( req . libraryItem )
Original file line number Diff line number Diff line change @@ -421,6 +421,10 @@ class LibraryItem extends Model {
421
421
if ( ! libraryItemId ) return null
422
422
423
423
const libraryItem = await this . findByPk ( libraryItemId )
424
+ if ( ! libraryItem ) {
425
+ Logger . error ( `[LibraryItem] Library item not found with id "${ libraryItemId } "` )
426
+ return null
427
+ }
424
428
425
429
if ( libraryItem . mediaType === 'podcast' ) {
426
430
libraryItem . media = await libraryItem . getMedia ( {
@@ -453,7 +457,7 @@ class LibraryItem extends Model {
453
457
} )
454
458
}
455
459
456
- if ( ! libraryItem ) return null
460
+ if ( ! libraryItem . media ) return null
457
461
return this . getOldLibraryItem ( libraryItem )
458
462
}
459
463
Original file line number Diff line number Diff line change @@ -152,7 +152,12 @@ class PodcastEpisode extends Model {
152
152
extraData : DataTypes . JSON
153
153
} , {
154
154
sequelize,
155
- modelName : 'podcastEpisode'
155
+ modelName : 'podcastEpisode' ,
156
+ indexes : [
157
+ {
158
+ fields : [ 'createdAt' ]
159
+ }
160
+ ]
156
161
} )
157
162
158
163
const { podcast } = sequelize . models
You can’t perform that action at this time.
0 commit comments