Skip to content

Commit fc53c5f

Browse files
committed
Retry errored media items
1 parent 1a9e04d commit fc53c5f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

app/models/media_item.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,15 @@ def fill_missing_details
5757
info = Youtube::Video.new(url).get_information
5858

5959
if info.present?
60-
# Wait for stream to finish
61-
success = info["is_live"] ? nil : !!info["id"]
6260

63-
if success && info['extractor'] == 'youtube'
61+
if info["id"] && info['extractor'] == 'youtube'
6462
video = Youtube::Video.from_id(info["id"])
6563
self.guid = video.guid
6664
self.url = video.url
6765
end
6866

69-
self.reachable = success
67+
# Wait for stream to finish
68+
self.reachable = info["id"].present? && !info["is_live"] || nil
7069
self.author = info["uploader"] || ''
7170
self.title = [info["is_live"] && "[LIVE]", feed&.title, info["title"]].select(&:present?).join(" - ")
7271
self.published_at = info["upload_date"] && Date.parse(info["upload_date"])

0 commit comments

Comments
 (0)