File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -127,20 +127,20 @@ module.exports = {
127
127
bookListeningMap [ ls . displayTitle ] += listeningSessionListeningTime
128
128
}
129
129
130
- const authors = ls . mediaMetadata . authors || [ ]
130
+ const authors = ls . mediaMetadata ? .authors || [ ]
131
131
authors . forEach ( ( au ) => {
132
132
if ( ! authorListeningMap [ au . name ] ) authorListeningMap [ au . name ] = 0
133
133
authorListeningMap [ au . name ] += listeningSessionListeningTime
134
134
} )
135
135
136
- const narrators = ls . mediaMetadata . narrators || [ ]
136
+ const narrators = ls . mediaMetadata ? .narrators || [ ]
137
137
narrators . forEach ( ( narrator ) => {
138
138
if ( ! narratorListeningMap [ narrator ] ) narratorListeningMap [ narrator ] = 0
139
139
narratorListeningMap [ narrator ] += listeningSessionListeningTime
140
140
} )
141
141
142
142
// Filter out bad genres like "audiobook" and "audio book"
143
- const genres = ( ls . mediaMetadata . genres || [ ] ) . filter ( ( g ) => g && ! g . toLowerCase ( ) . includes ( 'audiobook' ) && ! g . toLowerCase ( ) . includes ( 'audio book' ) )
143
+ const genres = ( ls . mediaMetadata ? .genres || [ ] ) . filter ( ( g ) => g && ! g . toLowerCase ( ) . includes ( 'audiobook' ) && ! g . toLowerCase ( ) . includes ( 'audio book' ) )
144
144
genres . forEach ( ( genre ) => {
145
145
if ( ! genreListeningMap [ genre ] ) genreListeningMap [ genre ] = 0
146
146
genreListeningMap [ genre ] += listeningSessionListeningTime
You can’t perform that action at this time.
0 commit comments