diff --git a/components.d.ts b/components.d.ts index 842ae72d..adba0235 100644 --- a/components.d.ts +++ b/components.d.ts @@ -10,6 +10,7 @@ declare module 'vue' { DialogCloseBtn: typeof import('./src/@core/components/DialogCloseBtn.vue')['default'] ErrorHeader: typeof import('./src/@core/components/ErrorHeader.vue')['default'] ExistIcon: typeof import('./src/@core/components/ExistIcon.vue')['default'] + LoadingBanner: typeof import('./src/@core/components/LoadingBanner.vue')['default'] MoreBtn: typeof import('./src/@core/components/MoreBtn.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] diff --git a/package.json b/package.json index 4d0456e7..2e0157c3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "moviepilot", - "version": "1.8.2", + "version": "1.8.2-2", "private": true, "bin": "dist/service.js", "scripts": { diff --git a/src/@core/components/LoadingBanner.vue b/src/@core/components/LoadingBanner.vue new file mode 100644 index 00000000..8e97558c --- /dev/null +++ b/src/@core/components/LoadingBanner.vue @@ -0,0 +1,28 @@ + + + + + + + {{ props.text }} + + diff --git a/src/App.vue b/src/App.vue index 762f79b6..1f367415 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,13 +2,8 @@ import { useToast } from 'vue-toast-notification' import { useTheme } from 'vuetify' import api from '@/api' - import store from './store' -import { fixArrayAt } from '@/@core/utils/compatibility' - -// 修复低版本Safari等浏览器数组不支持at函数的问题 -fixArrayAt() // 提示框 const $toast = useToast() diff --git a/src/api/types.ts b/src/api/types.ts index 1d0efbe1..ff6ebb33 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -88,6 +88,9 @@ export interface Subscribe { // 保存目录 save_path: string + + // 时间 + date: string } // 历史记录 diff --git a/src/components/FileBrowser.vue b/src/components/FileBrowser.vue index a3ec9e19..e4c7e9a3 100644 --- a/src/components/FileBrowser.vue +++ b/src/components/FileBrowser.vue @@ -1,9 +1,8 @@ diff --git a/src/components/cards/CardStatisticsHorizontal.vue b/src/components/cards/CardStatisticsHorizontal.vue deleted file mode 100644 index 6f083fd6..00000000 --- a/src/components/cards/CardStatisticsHorizontal.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - {{ props.title }} - - {{ kFormatter(props.stats) }} - - - {{ Math.abs(props.change) }}% - - - - - - diff --git a/src/components/cards/CardStatisticsVertical.vue b/src/components/cards/CardStatisticsVertical.vue deleted file mode 100644 index 67ad117a..00000000 --- a/src/components/cards/CardStatisticsVertical.vue +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - {{ props.title }} - - - {{ props.stats }} - - {{ isPositive ? `+${props.change}` : props.change }}% - - - {{ props.subtitle }} - - - diff --git a/src/components/cards/CardStatisticsWithImages.vue b/src/components/cards/CardStatisticsWithImages.vue deleted file mode 100644 index 1d2094df..00000000 --- a/src/components/cards/CardStatisticsWithImages.vue +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - {{ props.title }} - - - - {{ props.stats }} - - - {{ isPositive ? `+${props.change}` : props.change }}% - - - - - {{ props.subtitle }} - - - - - - - - - - - - - diff --git a/src/components/cards/LibraryCard.vue b/src/components/cards/LibraryCard.vue index 43ee7d98..f7c8d5b4 100644 --- a/src/components/cards/LibraryCard.vue +++ b/src/components/cards/LibraryCard.vue @@ -56,7 +56,7 @@ function getImgUrl(url: string) { if (!url) return getDefaultImage() else - return `${import.meta.env.VITE_API_BASE_URL}system/img/0/${encodeURIComponent(url).replace(/%2F/g, '/')}` + return `${import.meta.env.VITE_API_BASE_URL}system/img/0?imgurl=${encodeURIComponent(url)}` } // 根据多张图片生成媒体库封面 @@ -68,7 +68,7 @@ async function drawImages(imageList: string[]) { // 为所有图片添加system/img前缀 for (let i = 0; i < IMAGES.length; i++) - IMAGES[i] = `${import.meta.env.VITE_API_BASE_URL}system/img/0/${encodeURIComponent(IMAGES[i]).replace(/%2F/g, '/')}` + IMAGES[i] = `${import.meta.env.VITE_API_BASE_URL}system/img/0?imgurl=${encodeURIComponent(IMAGES[i])}` // canvas const canvas = canvasRef.value diff --git a/src/components/cards/MediaCard.vue b/src/components/cards/MediaCard.vue index 05155b98..37e8f295 100644 --- a/src/components/cards/MediaCard.vue +++ b/src/components/cards/MediaCard.vue @@ -1,7 +1,7 @@ @@ -53,7 +53,7 @@ function goPlay() { 'transition transform-cpu duration-300 scale-105 shadow-lg': hover.isHovering, 'ring-1': isImageLoaded, }" - @click.stop="goPlay" + @click.stop="goPlay(hover.isHovering)" > import type { PropType } from 'vue' import { useToast } from 'vue-toast-notification' -import SiteAddEditForm from '../form/SiteAddEditForm.vue' +import SiteAddEditDialog from '../dialog/SiteAddEditDialog.vue' import SiteTorrentTable from '../table/SiteTorrentTable.vue' import { requiredValidator } from '@/@validators' import api from '@/api' @@ -166,13 +166,19 @@ const statColor = computed(() => { } else if (siteStats.value?.lst_state == 0){ if (!siteStats.value?.seconds) - return 'success' + return 'secondary' if (siteStats.value?.seconds >= 5) return 'warning' return 'success' } }) +// 监听resourceDialog,如果为false则重新查询站点使用统计 +watch(resourceDialog, (value) => { + if (!value) + getSiteStats() +}) + // 装载时查询站点图标 onMounted(() => { getSiteIcon() @@ -360,7 +366,7 @@ onMounted(() => { - import { useToast } from 'vue-toast-notification' -import SubscribeEditForm from '../form/SubscribeEditForm.vue' +import SubscribeEditDialog from '../dialog/SubscribeEditDialog.vue' import { calculateTimeDifference } from '@/@core/utils' import { formatSeason } from '@/@core/utils/formatters' import api from '@/api' @@ -284,7 +284,7 @@ const dropdownItems = ref([ /> - +// 输入参数 +const props = defineProps({ + title: String, +}) + +// 定义事件 +const emit = defineEmits(['update:modelValue', 'close']) + +// 代码 +const codeString = ref('') + +// 导入 +function handleImport() { + emit('update:modelValue', codeString.value) + emit('close') +} + + + + + + + + + + + + + 导入 + + + + + diff --git a/src/components/form/ReorganizeForm.vue b/src/components/dialog/ReorganizeDialog.vue similarity index 99% rename from src/components/form/ReorganizeForm.vue rename to src/components/dialog/ReorganizeDialog.vue index c4fcc8f4..fa851c86 100644 --- a/src/components/form/ReorganizeForm.vue +++ b/src/components/dialog/ReorganizeDialog.vue @@ -1,6 +1,6 @@ + + + + + + {{ props.type + '订阅历史' }} + + { emit('close') }" /> + + + + + + + + + + + + + + + + + + + {{ item.name }} 第 {{ item.season }} 季 + + + {{ item.name }} + + {{ formatDateDifference(item.date) }} + {{ item.description }} + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ progressText }} + + + + + + diff --git a/src/components/filebrowser/List.vue b/src/components/filebrowser/FileList.vue similarity index 99% rename from src/components/filebrowser/List.vue rename to src/components/filebrowser/FileList.vue index effd063c..94934917 100644 --- a/src/components/filebrowser/List.vue +++ b/src/components/filebrowser/FileList.vue @@ -4,7 +4,7 @@ import type { PropType } from 'vue' import { useConfirm } from 'vuetify-use-dialog' import axios from 'axios' import { useToast } from 'vue-toast-notification' -import ReorganizeForm from '../form/ReorganizeForm.vue' +import ReorganizeDialog from '../dialog/ReorganizeDialog.vue' import { formatBytes } from '@core/utils/formatters' import type { Context, EndPoints, FileItem } from '@/api/types' import store from '@/store' @@ -535,7 +535,7 @@ onMounted(() => { - -// 输入参数 -const props = defineProps({ - title: String, -}) - -// 定义事件 -const emit = defineEmits(['update:modelValue', 'close']) - -// 代码 -const codeString = ref('') - -// 导入 -function handleImport() { - emit('update:modelValue', codeString.value) - emit('close') -} - - - - - - - - - - - - 导入 - - - - diff --git a/src/components/cards/TmdbSelectorCard.vue b/src/components/misc/TmdbSelector.vue similarity index 100% rename from src/components/cards/TmdbSelectorCard.vue rename to src/components/misc/TmdbSelector.vue diff --git a/src/main.ts b/src/main.ts index 0b64cc6c..35573818 100644 --- a/src/main.ts +++ b/src/main.ts @@ -18,7 +18,12 @@ import 'vue-toast-notification/dist/theme-bootstrap.css' import { PerfectScrollbarPlugin } from 'vue3-perfect-scrollbar'; import 'vue3-perfect-scrollbar/style.css'; import DialogCloseBtn from '@/@core/components/DialogCloseBtn.vue' +import { fixArrayAt } from '@/@core/utils/compatibility' +// 修复低版本Safari等浏览器数组不支持at函数的问题 +fixArrayAt() + +// 加载字体 loadFonts() // 创建Vue实例 diff --git a/src/pages/resource.vue b/src/pages/resource.vue index 264fc39b..2e72ef65 100644 --- a/src/pages/resource.vue +++ b/src/pages/resource.vue @@ -120,11 +120,12 @@ onMounted(() => { - - - - {{ progressText }} - + - - - + class="mt-12" + /> + ({}) // 订阅编号 const subscribeId = ref() -// 订阅规则 -const subscribeRules = ref({ - show_edit_dialog: false, -}) - // 获得mediaid function getMediaId() { return mediaDetail.value?.tmdb_id @@ -230,9 +225,12 @@ async function addSubscribe(season = 0) { ) // 显示编辑弹窗 - if (result.success && subscribeRules.value.show_edit_dialog) { - subscribeId.value = result.data.id - subscribeEditDialog.value = true + if (result.success) { + const show_edit_dialog = await queryDefaultSubscribeConfig() + if (show_edit_dialog) { + subscribeId.value = result.data.id + subscribeEditDialog.value = true + } } } catch (error) { @@ -290,20 +288,6 @@ async function removeSubscribe(season: number) { doneNProgress() } -// 查询订阅弹窗规则 -async function querySubscribeRules() { - try { - const result: { [key: string]: any } = await api.get( - 'system/setting/DefaultFilterRules', - ) - if (result.data?.value) - subscribeRules.value = result.data?.value - } - catch (error) { - console.log(error) - } -} - // 订阅按钮响应 function handleSubscribe(season = 0) { if (isSubscribed.value) @@ -450,23 +434,35 @@ async function handlePlay() { } } +async function queryDefaultSubscribeConfig() { + try { + let subscribe_config_url = '' + if (mediaProps.type === '电影') + subscribe_config_url = 'system/setting/DefaultMovieSubscribeConfig' + else + subscribe_config_url = 'system/setting/DefaultTvSubscribeConfig' + + const result: { [key: string]: any } = await api.get(subscribe_config_url) + + if (result.data?.value) + return result.data.value.show_edit_dialog + } + catch (error) { + console.log(error) + } + return false +} + onBeforeMount(() => { getMediaDetail() - querySubscribeRules() }) - - - + class="mt-12" + /> @@ -638,16 +634,10 @@ onBeforeMount(() => { - - - + class="mt-3" + /> @@ -849,7 +839,7 @@ onBeforeMount(() => { error-description="未识别到媒体信息。" /> - - - - + class="mt-12" + /> + { - - - + class="mt-12" + /> { - - - + class="mt-12" + /> { - - - + class="mt-12" + /> { - - - + class="mt-12" + /> - { width="60rem" scrollable > - { hint="小于该值的资源将被过滤掉,0表示不过滤" /> - - - @@ -648,7 +640,7 @@ onMounted(() => { width="60rem" scrollable > - - - - + class="mt-12" + /> - { - + { } .v-application .fc .fc-daygrid-day-number { - padding-block: 0rem; - padding-inline: 0rem; + padding-block: 0; + padding-inline: 0; } .v-application .fc .fc-list-event-dot { @@ -435,7 +435,7 @@ onMounted(() => { margin-inline-end: 0.25rem; } -@media (max-width: 1264px) { +@media (width <= 1264px) { .v-application .fc .fc-toolbar-chunk .fc-button-group .fc-drawerToggler-button { display: block !important; } @@ -481,10 +481,10 @@ onMounted(() => { } .v-application .fc .fc-button-primary { - background-color: transparent; border: none; - outline: none; + background-color: transparent; color: var(--v-theme-on-surface); + outline: none; } .v-application .fc .fc-button-primary:hover { @@ -492,7 +492,7 @@ onMounted(() => { color: rgb(var(--v-theme-primary)); } -@media (max-width: 776px) { +@media (width <= 776px) { .fc-daygrid-event-harness { display: flex; align-items: center; diff --git a/src/views/subscribe/SubscribeListView.vue b/src/views/subscribe/SubscribeListView.vue index e7720714..32bd22dd 100644 --- a/src/views/subscribe/SubscribeListView.vue +++ b/src/views/subscribe/SubscribeListView.vue @@ -4,7 +4,8 @@ import api from '@/api' import type { Subscribe } from '@/api/types' import NoDataFound from '@/components/NoDataFound.vue' import SubscribeCard from '@/components/cards/SubscribeCard.vue' -import SubscribeEditForm from '@/components/form/SubscribeEditForm.vue' +import SubscribeEditDialog from '@/components/dialog/SubscribeEditDialog.vue' +import SubscribeHistoryDialog from '@/components/dialog/SubscribeHistoryDialog.vue' import store from '@/store' // 输入参数 @@ -21,6 +22,9 @@ const dataList = ref([]) // 弹窗 const subscribeEditDialog = ref(false) +// 历史记录弹窗 +const historyDialog = ref(false) + // 获取订阅列表数据 async function fetchData() { try { @@ -58,17 +62,10 @@ const filteredDataList = computed(() => { - - - + class="mt-12" + /> { appear @click="subscribeEditDialog = true" /> + - { @save="subscribeEditDialog = false" @close="subscribeEditDialog = false" /> + + {historyDialog = false; fetchData()}" + />