mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 23:56:42 +08:00
fix: hide episode sort for movie subscriptions
This commit is contained in:
+24
-7
@@ -91,15 +91,28 @@ const filterOptions = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// 排序选项
|
// 排序选项
|
||||||
const sortOptions = computed<Array<{ value: SubscribeSortBy; label: string }>>(() => [
|
const sortOptions = computed<Array<{ value: SubscribeSortBy; label: string }>>(() => {
|
||||||
{ value: 'custom', label: t('subscribe.sort.custom') },
|
const options: Array<{ value: SubscribeSortBy; label: string }> = [
|
||||||
{ value: 'last_update', label: t('subscribe.sort.lastUpdate') },
|
{ value: 'custom', label: t('subscribe.sort.custom') },
|
||||||
{ value: 'date', label: t('subscribe.sort.addTime') },
|
{ value: 'last_update', label: t('subscribe.sort.lastUpdate') },
|
||||||
{ value: 'lack_episode', label: t('subscribe.sort.lackEpisode') },
|
{ value: 'date', label: t('subscribe.sort.addTime') },
|
||||||
])
|
]
|
||||||
|
|
||||||
|
if (subType !== '电影') {
|
||||||
|
options.push({ value: 'lack_episode', label: t('subscribe.sort.lackEpisode') })
|
||||||
|
}
|
||||||
|
|
||||||
|
return options
|
||||||
|
})
|
||||||
|
|
||||||
// 当前选中的排序选项
|
// 当前选中的排序选项
|
||||||
const currentSortBy = computed<SubscribeSortBy>(() => subscribeSortBy.value || 'date')
|
const currentSortBy = computed<SubscribeSortBy>(() => {
|
||||||
|
if (subscribeSortBy.value && sortOptions.value.some(option => option.value === subscribeSortBy.value)) {
|
||||||
|
return subscribeSortBy.value
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'date'
|
||||||
|
})
|
||||||
|
|
||||||
// 当前选中的筛选选项
|
// 当前选中的筛选选项
|
||||||
const currentFilter = computed(() => {
|
const currentFilter = computed(() => {
|
||||||
@@ -122,6 +135,10 @@ function selectFilter(value: string) {
|
|||||||
|
|
||||||
// 选择订阅排序选项,非自定义排序会退出拖拽排序模式。
|
// 选择订阅排序选项,非自定义排序会退出拖拽排序模式。
|
||||||
function selectSubscribeSort(value: SubscribeSortBy) {
|
function selectSubscribeSort(value: SubscribeSortBy) {
|
||||||
|
if (!sortOptions.value.some(option => option.value === value)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
subscribeSortBy.value = value
|
subscribeSortBy.value = value
|
||||||
if (value !== 'custom') {
|
if (value !== 'custom') {
|
||||||
subscribeSortMode.value = false
|
subscribeSortMode.value = false
|
||||||
|
|||||||
@@ -79,8 +79,18 @@ const selectedSubscribes = ref<number[]>([])
|
|||||||
const normalizedKeyword = computed(() => props.keyword?.trim().toLowerCase() || '')
|
const normalizedKeyword = computed(() => props.keyword?.trim().toLowerCase() || '')
|
||||||
const selectedSubscribesSet = computed(() => new Set(selectedSubscribes.value))
|
const selectedSubscribesSet = computed(() => new Set(selectedSubscribes.value))
|
||||||
const hasCustomOrder = computed(() => orderConfig.value.length > 0)
|
const hasCustomOrder = computed(() => orderConfig.value.length > 0)
|
||||||
|
|
||||||
|
// 归一化订阅排序方式,电影订阅不使用缺失集数排序。
|
||||||
|
const normalizedSortBy = computed<SubscribeSortBy | ''>(() => {
|
||||||
|
const sortBy = props.sortBy as SubscribeSortBy | ''
|
||||||
|
if (props.type === '电影' && sortBy === 'lack_episode') {
|
||||||
|
return 'date'
|
||||||
|
}
|
||||||
|
|
||||||
|
return sortBy
|
||||||
|
})
|
||||||
const effectiveSortBy = computed<SubscribeSortBy>(() => {
|
const effectiveSortBy = computed<SubscribeSortBy>(() => {
|
||||||
return (props.sortBy as SubscribeSortBy) || (hasCustomOrder.value ? 'custom' : 'date')
|
return normalizedSortBy.value || (hasCustomOrder.value ? 'custom' : 'date')
|
||||||
})
|
})
|
||||||
const canSortContext = computed(
|
const canSortContext = computed(
|
||||||
() =>
|
() =>
|
||||||
|
|||||||
Reference in New Issue
Block a user