Skip to content

Commit 9205ccc

Browse files
committed
Removed dummy values and added checks for items.ecr
1 parent 00df3e2 commit 9205ccc

File tree

5 files changed

+8
-20
lines changed

5 files changed

+8
-20
lines changed

src/invidious/channels/channels.cr

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ struct ChannelVideo
2121
property live_now : Bool = false
2222
property premiere_timestamp : Time? = nil
2323
property views : Int64? = nil
24-
property author_verified : Bool #TODO currently a dummy
2524

2625
def to_json(locale, json : JSON::Builder)
2726
json.object do
@@ -219,7 +218,6 @@ def fetch_channel(ucid, pull_all_videos : Bool)
219218
live_now: live_now,
220219
premiere_timestamp: premiere_timestamp,
221220
views: views,
222-
author_verified: false, #TODO dummy for components/item.ecr
223221
})
224222

225223
LOGGER.trace("fetch_channel: #{ucid} : video #{video_id} : Updating or inserting video")
@@ -257,7 +255,6 @@ def fetch_channel(ucid, pull_all_videos : Bool)
257255
live_now: video.live_now,
258256
premiere_timestamp: video.premiere_timestamp,
259257
views: video.views,
260-
author_verified: false, #TODO dummy for components/item.ecr
261258
}) }
262259

263260
videos.each do |video|

src/invidious/mixes.cr

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ struct MixVideo
88
property length_seconds : Int32
99
property index : Int32
1010
property rdid : String
11-
12-
def author_verified
13-
false #TODO dummy
14-
end
11+
1512
end
1613

1714
struct Mix

src/invidious/playlists.cr

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,6 @@ struct InvidiousPlaylist
234234
0_i64
235235
end
236236

237-
def author_verified
238-
false # TODO dummy for components/item.ecr
239-
end
240237

241238
def description_html
242239
HTML.escape(self.description)
@@ -255,8 +252,7 @@ def create_playlist(title, privacy, user)
255252
created: Time.utc,
256253
updated: Time.utc,
257254
privacy: privacy,
258-
index: [] of Int64,
259-
author_verified: false, # TODO dummy for components/item.ecr
255+
index: [] of Int64
260256
})
261257

262258
Invidious::Database::Playlists.insert(playlist)
@@ -274,8 +270,7 @@ def subscribe_playlist(user, playlist)
274270
created: Time.utc,
275271
updated: playlist.updated,
276272
privacy: PlaylistPrivacy::Private,
277-
index: [] of Int64,
278-
author_verified: false, # TODO dummy for components/item.ecr
273+
index: [] of Int64
279274
})
280275

281276
Invidious::Database::Playlists.insert(playlist)

src/invidious/routes/feeds.cr

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ module Invidious::Routes::Feeds
156156

157157
response = YT_POOL.client &.get("/feeds/videos.xml?channel_id=#{channel.ucid}")
158158
rss = XML.parse_html(response.body)
159-
159+
print(response)
160160
videos = rss.xpath_nodes("//feed/entry").map do |entry|
161161
video_id = entry.xpath_node("videoid").not_nil!.content
162162
title = entry.xpath_node("title").not_nil!.content
@@ -182,7 +182,7 @@ module Invidious::Routes::Feeds
182182
paid: false,
183183
premium: false,
184184
premiere_timestamp: nil,
185-
author_verified: false, #TODO real value
185+
author_verified: false, # ¯\_(ツ)_/¯
186186
})
187187
end
188188

@@ -415,7 +415,6 @@ module Invidious::Routes::Feeds
415415
live_now: video.live_now,
416416
premiere_timestamp: video.premiere_timestamp,
417417
views: video.views,
418-
author_verified: false, #TODO dummy for components/item.ecr
419418
})
420419

421420
was_insert = Invidious::Database::ChannelVideos.insert(video, with_premiere_timestamp: true)

src/invidious/views/components/item.ecr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<p dir="auto"><%= HTML.escape(item.title) %></p>
3131
</a>
3232
<a href="/channel/<%= item.ucid %>">
33-
<p dir="auto"><b><%= HTML.escape(item.author) %><% if !item.author_verified.nil? && item.author_verified %><i class="icon ion ion-md-checkmark-circle"></i><% end %></b></p>
33+
<p dir="auto"><b><%= HTML.escape(item.author) %><% if !item.is_a?(InvidiousPlaylist) && !item.author_verified.nil? && item.author_verified %><i class="icon ion ion-md-checkmark-circle"></i><% end %></b></p>
3434
</a>
3535
<% when MixVideo %>
3636
<a href="/watch?v=<%= item.id %>&list=<%= item.rdid %>">
@@ -45,7 +45,7 @@
4545
<p dir="auto"><%= HTML.escape(item.title) %></p>
4646
</a>
4747
<a href="/channel/<%= item.ucid %>">
48-
<p dir="auto"><b><%= HTML.escape(item.author) %><% if !item.author_verified.nil? && item.author_verified %><i class="icon ion ion-md-checkmark-circle"></i><% end %></b></p>
48+
<p dir="auto"><b><%= HTML.escape(item.author) %><% if !item.is_a?(MixVideo) && !item.author_verified.nil? && item.author_verified %><i class="icon ion ion-md-checkmark-circle"></i><% end %></b></p>
4949
</a>
5050
<% when PlaylistVideo %>
5151
<a style="width:100%" href="/watch?v=<%= item.id %>&list=<%= item.plid %>&index=<%= item.index %>">
@@ -142,7 +142,7 @@
142142

143143
<div class="video-card-row flexible">
144144
<div class="flex-left"><a href="/channel/<%= item.ucid %>">
145-
<p class="channel-name" dir="auto"><%= HTML.escape(item.author) %><% if !item.author_verified.nil? && item.author_verified %><i class="icon ion ion-md-checkmark-circle"></i><% end %></p>
145+
<p class="channel-name" dir="auto"><%= HTML.escape(item.author) %><% if !item.is_a?(ChannelVideo) && !item.author_verified.nil? && item.author_verified %><i class="icon ion ion-md-checkmark-circle"></i><% end %></p>
146146
</a></div>
147147

148148
<% endpoint_params = "?v=#{item.id}" %>

0 commit comments

Comments
 (0)