diff --git a/cli/dehydrate_posters.go b/cli/dehydrate_posters.go index caf75c4..f30aaa5 100644 --- a/cli/dehydrate_posters.go +++ b/cli/dehydrate_posters.go @@ -41,9 +41,15 @@ func DehydratePosters(force bool) error { dehydratedPosters := make(map[string][]string) dehydratedRepColors := make(map[string][]string) + dehydratedInputMissing := make(map[string][]string) for _, videoId := range videoIds { + if rdx.HasKey(data.VideoDehydratedInputMissingProperty, videoId) && !force { + dpa.Increment() + continue + } + if rdx.HasKey(data.VideoDehydratedThumbnailProperty, videoId) && !force { dpa.Increment() continue @@ -53,7 +59,7 @@ func DehydratePosters(force bool) error { dehydratedPosters[videoId] = append(dehydratedPosters[videoId], dp) dehydratedRepColors[videoId] = append(dehydratedRepColors[videoId], rc) } else if errors.Is(err, ErrVideoHasNoPosterThumbnail) { - // do nothing + dehydratedInputMissing[videoId] = append(dehydratedInputMissing[videoId], "true") } else { dpa.Error(err) } @@ -69,6 +75,10 @@ func DehydratePosters(force bool) error { return dpa.EndWithError(err) } + if err := rdx.BatchReplaceValues(data.VideoDehydratedInputMissingProperty, dehydratedInputMissing); err != nil { + return dpa.EndWithError(err) + } + return nil } diff --git a/data/properties.go b/data/properties.go index 0f96221..a83be9b 100644 --- a/data/properties.go +++ b/data/properties.go @@ -20,8 +20,9 @@ const ( VideoErrorsProperty = "video-errors" VideoFavoriteProperty = "video-favorite" - VideoDehydratedThumbnailProperty = "video-dehydrated-thumbnail" - VideoDehydratedRepColorProperty = "video-dehydrate-rep-color" + VideoDehydratedThumbnailProperty = "video-dehydrated-thumbnail" + VideoDehydratedRepColorProperty = "video-dehydrated-rep-color" + VideoDehydratedInputMissingProperty = "video-dehydrated-input-missing" VideoForcedDownloadProperty = "video-forced-download" @@ -62,6 +63,7 @@ func VideoProperties() []string { VideoThumbnailUrlsProperty, VideoDehydratedThumbnailProperty, VideoDehydratedRepColorProperty, + VideoDehydratedInputMissingProperty, VideoExternalChannelIdProperty, VideoShortDescriptionProperty, VideoViewCountProperty,