13 Commits

Author SHA1 Message Date
André Eriksen
6ccb0520cf
Record the content kind of subscription feed entries
Upstream has no way to tell a Short from a long-form upload in a feed:
`ChannelVideo#to_json` reports `"type": "shortVideo"` for every row, and
`channel_videos.length_seconds` is 0 for anything absent from the channel's
Videos tab — Shorts and stream VODs alike. 531 of 1586 rows (34%) were in
that state.

YouTube's per-channel uploads playlists supply the signal, addressed by
replacing the "UC" of the channel ID: UULF long-form, UUSH Shorts, UULV live.
Measured over 75 channels, 15 newest entries each: 1114 long-form, 679 Shorts,
299 live, one Short leaking into a UULF feed.

ClassifyChannelVideosJob labels `kind` from those feeds, falling back to a
capped `HEAD /shorts/<id>` probe (200 = Short, 303 = not) for rows older than
a 15-entry window. `feed_kinds` restricts the subscription feed via a
predicate in each user's materialized view.

A separate job rather than an edit to `fetch_channel`, and `kind` is absent
from the insert's `ON CONFLICT DO UPDATE` set, so a channel refresh cannot
overwrite a label. Unclassified entries are always shown and an empty
`feed_kinds` admits everything, so the feed cannot end up blank.

Also folds in three pre-existing ameba Performance/ChainedCallWithNoBang
fixes in arik_settings.cr and admin_settings.cr, which a newer ameba release
started flagging.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-30 16:41:12 +02:00
Andre Borie
ffa9e5dfab Make migrations (mostly) idempotent. 2021-01-17 14:20:34 +00:00
Omar Roth
64464f23ae
Add 'views' to channel_videos 2019-05-30 18:59:13 -05:00
Omar Roth
42dd6326d5 Remove unnecessary index 2019-04-28 14:11:23 -05:00
Omar Roth
fd26f9f34e Add support for premieres to search and feed 2019-03-22 14:54:35 -05:00
Omar Roth
52cad8d6da Update change index for channel_videos and add index for nonces 2019-02-11 10:59:17 -06:00
Omar Roth
19632511d5 Update SQL 2018-11-02 09:46:45 -05:00
Omar Roth
c55c553725 Fix channel_videos schema 2018-10-30 10:50:27 -05:00
Omar Roth
8794e26e67 Add length_seconds to channel_videos 2018-10-30 09:20:51 -05:00
Omar Roth
51d00b16c3 Use hash instead of btree for channel_videos_ucid_idx 2018-09-21 08:52:27 -05:00
Omar Roth
b13b91e2bf Add ucid index for channel_videos 2018-07-27 17:38:47 -05:00
Omar Roth
6c4cfbe39d Add users table 2018-03-29 21:41:05 -05:00
Omar Roth
239a6c892c Use seperate table for videos pulled from RSS 2018-03-28 22:29:54 -05:00