mirror of
https://github.com/iv-org/invidious.git
synced 2026-09-06 00:52:45 -05:00
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>
32 lines
711 B
SQL
32 lines
711 B
SQL
-- Table: public.channel_videos
|
|
|
|
-- DROP TABLE public.channel_videos;
|
|
|
|
CREATE TABLE IF NOT EXISTS public.channel_videos
|
|
(
|
|
id text NOT NULL,
|
|
title text,
|
|
published timestamp with time zone,
|
|
updated timestamp with time zone,
|
|
ucid text,
|
|
author text,
|
|
length_seconds integer,
|
|
live_now boolean,
|
|
premiere_timestamp timestamp with time zone,
|
|
views bigint,
|
|
kind text,
|
|
CONSTRAINT channel_videos_id_key UNIQUE (id)
|
|
);
|
|
|
|
GRANT ALL ON TABLE public.channel_videos TO current_user;
|
|
|
|
-- Index: public.channel_videos_ucid_idx
|
|
|
|
-- DROP INDEX public.channel_videos_ucid_idx;
|
|
|
|
CREATE INDEX IF NOT EXISTS channel_videos_ucid_idx
|
|
ON public.channel_videos
|
|
USING btree
|
|
(ucid COLLATE pg_catalog."default");
|
|
|