mirror of
https://github.com/iv-org/invidious.git
synced 2024-10-01 01:25:56 -04:00
Compare commits
4 Commits
cf1c645021
...
aa542da2cd
Author | SHA1 | Date | |
---|---|---|---|
|
aa542da2cd | ||
|
53e8a5d62d | ||
|
bf1123682e | ||
|
7b600cd4e1 |
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@ -6,7 +6,7 @@ docker/ @unixfox
|
||||
kubernetes/ @unixfox
|
||||
|
||||
README.md @thefrenchghosty
|
||||
config/config.example.yml @thefrenchghosty @SamantazFox @unixfox
|
||||
config/config.example.yml @SamantazFox @unixfox
|
||||
|
||||
scripts/ @syeopite
|
||||
shards.lock @syeopite
|
||||
|
@ -4,6 +4,7 @@ struct Invidious::User
|
||||
|
||||
def to_invidious(user : User)
|
||||
playlists = Invidious::Database::Playlists.select_like_iv(user.email)
|
||||
youtube_playlists = Invidious::Database::Playlists.select_not_like_iv(user.email)
|
||||
|
||||
return JSON.build do |json|
|
||||
json.object do
|
||||
@ -28,6 +29,18 @@ struct Invidious::User
|
||||
end
|
||||
end
|
||||
end
|
||||
json.field "youtube_playlists" do
|
||||
json.array do
|
||||
youtube_playlists.each do |playlist|
|
||||
json.object do
|
||||
json.field "title", playlist.title
|
||||
json.field "id", playlist.id
|
||||
json.field "video_count", playlist.video_count
|
||||
json.field "updated", playlist.updated
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -155,6 +155,15 @@ struct Invidious::User
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if youtube_playlists = data["youtube_playlists"]?.try &.as_a?
|
||||
playlists.each do |item|
|
||||
begin
|
||||
subscribe_playlist(user, item)
|
||||
rescue ex
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# -------------------
|
||||
|
Loading…
Reference in New Issue
Block a user