fix(fc3b): SourceFormDialog + SubscriptionsView read platforms store; drop sources.loadPlatforms

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-20 18:39:44 -04:00
parent a0203f4727
commit 408971a798
4 changed files with 20 additions and 25 deletions
@@ -20,7 +20,13 @@
Adding source for <strong>{{ initialArtist.name }}</strong>
</div>
<v-select v-model="platform" :items="store.platforms" label="Platform" />
<v-select
v-model="platform"
:items="platformsItems"
item-value="value"
item-title="title"
label="Platform"
/>
<v-text-field v-model="url" label="URL" :error-messages="urlError" />
<v-switch v-model="enabled" label="Enabled" color="accent" hide-details />
@@ -65,6 +71,7 @@
<script setup>
import { computed, ref, watch } from 'vue'
import { useSourcesStore } from '../../stores/sources.js'
import { usePlatformsStore } from '../../stores/platforms.js'
const props = defineProps({
modelValue: { type: Boolean, default: false },
@@ -73,6 +80,11 @@ const props = defineProps({
})
const emit = defineEmits(['update:modelValue', 'saved'])
const store = useSourcesStore()
const platformsStore = usePlatformsStore()
const platformsItems = computed(() =>
platformsStore.list.map(p => ({ value: p.key, title: p.name }))
)
const artistChoice = ref(null)
const artistMatches = ref([])
@@ -128,7 +140,7 @@ const canSave = computed(() => !jsonError.value && !!url.value.trim())
watch(() => props.modelValue, async (open) => {
if (!open) return
urlError.value = ''; jsonError.value = ''
await store.loadPlatforms()
await platformsStore.loadAll()
if (props.source) {
platform.value = props.source.platform
url.value = props.source.url
@@ -139,7 +151,7 @@ watch(() => props.modelValue, async (open) => {
jsonText.value = JSON.stringify(co, null, 2)
artistChoice.value = { id: props.source.artist_id, name: props.source.artist_name }
} else {
platform.value = store.platforms[0] || 'patreon'
platform.value = platformsStore.list[0]?.key || 'patreon'
url.value = ''; enabled.value = true
structuredVideos.value = true; structuredSince.value = ''
jsonText.value = '{}'