Files
FabledCurator/frontend/src/components/subscriptions/SourceActions.vue
T
bvandeusen d8d8ecd78f
CI / lint (push) Successful in 2s
CI / frontend-build (push) Successful in 21s
CI / backend-lint-and-test (push) Successful in 28s
CI / integration (push) Failing after 3m18s
feat(subscribestar): flip dispatch to the native ingester (#893, Step 5)
SubscribeStar now downloads + verifies through the native core ingester instead
of gallery-dl — the go-live switch for milestone #71.

- download_backends: subscribestar added to NATIVE_INGESTER_PLATFORMS; a
  _NATIVE_INGESTERS registry + _resolve_native_campaign_id make _run_native_ingester
  / preview_source / verify_source_credential platform-aware. SubscribeStar's
  campaign_id IS the creator URL (no resolver); Patreon still resolves the vanity.
  preview now catches the shared NativeIngestError (covers both platforms).
- platform_lock: subscribestar serialized (one paced walk at a time).
- gallery_dl: subscribestar entry removed from PLATFORM_DEFAULTS (rule 22 — no
  fallback once native works).
- frontend SourceActions: isPatreon → isNative (patreon|subscribestar) so the
  recover/recapture actions show for subscribestar; download_service's
  cursor/mode/post_first + the preview endpoint already key on
  uses_native_ingester, so backfill/recovery/recapture/preview light up for free.
- tests: download_backends (subscribestar native), platform_lock (serialized),
  and three gallery-dl-sample tests repointed to hentaifoundry (api_credentials
  verify, gallery_dl_service skip-value, api_sources arm-no-preflight).

post_is_gated stays best-effort (can't cause junk downloads); not gating this.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 12:03:48 -04:00

90 lines
3.3 KiB
Vue

<template>
<!-- Shared per-source action cluster (desktop SourceRow + mobile SourceCard).
Frequent actions stay as buttons; low-frequency / destructive ones move
into a labelled overflow menu so they can't be mis-clicked, and the
labels spell out what each one does (recover vs backfill). -->
<div class="fc-src-actions">
<v-btn
icon size="small" variant="text" :loading="checking"
@click.stop="emit('check', source)"
>
<v-icon>mdi-play</v-icon>
<v-tooltip activator="parent" location="top">
Check now — fetch posts published since the last check
</v-tooltip>
</v-btn>
<v-btn
icon size="small" variant="text"
:color="running ? 'warning' : undefined"
@click.stop="emit('backfill', source)"
>
<v-icon>{{ running ? 'mdi-stop' : 'mdi-magnify-scan' }}</v-icon>
<v-tooltip activator="parent" location="top">
{{ running
? (recovering ? 'Stop recovery' : (recapturing ? 'Stop recapture' : 'Stop backfill'))
: 'Backfill one-time walk of the FULL post history until complete' }}
</v-tooltip>
</v-btn>
<KebabMenu size="small" :min-width="260" label="More actions">
<v-list-item
v-if="isNative && !running"
prepend-icon="mdi-backup-restore"
@click="emit('recover', source)"
>
<v-list-item-title>Recover dropped near-duplicates</v-list-item-title>
<v-list-item-subtitle>
Re-fetch images previously dropped as near-dups and re-judge them
under the current similarity threshold
</v-list-item-subtitle>
</v-list-item>
<v-list-item
v-if="isNative && !running"
prepend-icon="mdi-text-box-search-outline"
@click="emit('recapture', source)"
>
<v-list-item-title>Recapture post text &amp; links</v-list-item-title>
<v-list-item-subtitle>
Re-grab every post's body + external links and localize inline images
already on disk without re-downloading media
</v-list-item-subtitle>
</v-list-item>
<v-divider v-if="isNative && !running" />
<v-list-item
base-color="error"
prepend-icon="mdi-delete-outline"
@click="emit('remove', source)"
>
<v-list-item-title>Remove source</v-list-item-title>
</v-list-item>
</KebabMenu>
</div>
</template>
<script setup>
import { computed } from 'vue'
import KebabMenu from '../common/KebabMenu.vue'
const props = defineProps({
source: { type: Object, required: true },
checking: { type: Boolean, default: false },
})
const emit = defineEmits(['check', 'backfill', 'recover', 'recapture', 'remove'])
const running = computed(() => props.source.backfill_state === 'running')
const recovering = computed(() => !!props.source.backfill_bypass_seen)
const recapturing = computed(() => !!props.source.backfill_recapture)
// Recover / recapture are native-ingester features (ledger-bypass re-walk and
// post-text re-grab), available to every native platform — not just Patreon.
const NATIVE_PLATFORMS = ['patreon', 'subscribestar']
const isNative = computed(() => NATIVE_PLATFORMS.includes(props.source.platform))
</script>
<style scoped>
.fc-src-actions {
display: inline-flex;
align-items: center;
gap: 2px;
}
</style>