Skip to content

Commit

Permalink
remove universal filter method instead single
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiram committed Jul 30, 2023
1 parent e2c3637 commit 4fca9d9
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 123 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,13 @@
"key": "39kan",
"name": "39影视", // 名称
"api": "https://www.39kan.com/api.php/provide/vod/", // 站点源地址
"type": 1, // 0:cms(xml) 1:cms(json) 2:drpy 3:app(v3)
"type": 1, // 0:cms(xml) 1:cms(json) 2:drpy 3:app(v3) 4:app(v1)
"search": 1, // 0:关闭 1:聚合搜索 2:本站搜索
"playUrl": "", // 配合解析去url地址
"group": "影视", // 分组
"isActive": true, // 是否启用 true启用 false 禁用
"status": true, // 状态 true可用 false 失效
"categories": "" // 按顺序展示所配置的分类 不配置则默认展示所有分类
}
]
},
Expand Down Expand Up @@ -121,6 +122,7 @@
"group": "影视",
"isActive": true,
"status": true,
"categories": ""
}
]
```
Expand Down Expand Up @@ -199,7 +201,5 @@
| ![直播播放](https://s2.loli.net/2023/05/07/e3GufyD1Um6h2iK.png) | ![解析](https://s2.loli.net/2023/05/07/qoAfuET4Lvn1kl7.png) |
| 历史记录 | 在追 |
| ![历史](https://s2.loli.net/2023/05/07/KYUpQA7g2MGVIZb.png) | ![在追](https://s2.loli.net/2023/05/07/xuMkzWQLYCSl5XZ.png) |
| 社区 | 设置 |
| ![社区](https://s2.loli.net/2023/05/07/r31qEmNPTGouOXb.png) | ![设置](https://s2.loli.net/2023/05/07/RgDOlzJKBcop2d6.png) |

</details>
18 changes: 2 additions & 16 deletions src/lib/dexie/dexie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,9 @@ db.version(19).stores({
})
})

// db.version(20).stores({
// setting: 'id, theme, externalPlayer, rootClassFilter, r18ClassFilter, defaultHot, defaultSearchRecommend, defaultSearchType, defaultCheckModel, defaultChangeModel, defaultIptvEpg, iptvSkipIpv6, iptvThumbnail, restoreWindowPositionAndSize, pauseWhenMinimize, defaultSite, defaultIptv, defaultAnalyze, analyzeFlag, analyzeSupport, broadcasterType, softSolution, skipStartEnd, agreementMask, recordShortcut, selfBoot, hardwareAcceleration, doh',
// sites: '++id, key, name, api, download, playUrl, type, isActive, group, search, resource',
// }).upgrade(trans => {
// trans.setting.toCollection().modify(setting => {
// setting.defaultSearchType = setting.defaultSearch
// setting.defaultSearchRecommend = setting.defaultHot
// setting.defaultHot = "kylive"
// })
// })

db.version(20).stores({
sites: '++id, key, name, api, download, playUrl, type, isActive, group, search, resource',
})

db.version(21).stores({
setting: 'id, theme, externalPlayer, rootClassFilter, r18ClassFilter, defaultHot, defaultSearchRecommend, defaultSearchType, defaultCheckModel, defaultChangeModel, defaultIptvEpg, iptvSkipIpv6, iptvThumbnail, restoreWindowPositionAndSize, pauseWhenMinimize, defaultSite, defaultIptv, defaultAnalyze, analyzeFlag, analyzeSupport, broadcasterType, softSolution, skipStartEnd, agreementMask, recordShortcut, selfBoot, hardwareAcceleration, doh',
setting: 'id, theme, externalPlayer, defaultHot, defaultSearchRecommend, defaultSearchType, defaultCheckModel, defaultChangeModel, defaultIptvEpg, iptvSkipIpv6, iptvThumbnail, restoreWindowPositionAndSize, pauseWhenMinimize, defaultSite, defaultIptv, defaultAnalyze, analyzeFlag, analyzeSupport, broadcasterType, softSolution, skipStartEnd, agreementMask, recordShortcut, selfBoot, hardwareAcceleration, doh',
sites: '++id, key, name, api, download, playUrl, type, isActive, group, search, resource, categories',
}).upgrade(trans => {
trans.setting.toCollection().modify(setting => {
setting.defaultSearchType = setting.defaultSearch
Expand Down
33 changes: 0 additions & 33 deletions src/lib/dexie/init/Setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,6 @@
"id": 0,
"theme": "auto",
"externalPlayer": "",
"rootClassFilter": [
"电影",
"电影片",
"电视剧",
"连续剧",
"综艺",
"动漫",
"公告头条",
"电影资讯",
"电视资讯",
"综艺资讯",
"动漫资讯",
"新闻资讯",
"娱乐新闻",
"电影解说",
"预告片"
],
"r18ClassFilter": [
"伦理",
"论理",
"倫理",
"福利",
"激情",
"理论",
"写真",
"情色",
"美女",
"街拍",
"赤足",
"性感",
"里番",
"VIP"
],
"defaultHot": "kylive",
"defaultSearchRecommend": "site",
"defaultSearchType": "site",
Expand Down
12 changes: 7 additions & 5 deletions src/pages/setting/analyze/components/DialogAdd.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<template>
<t-dialog v-model:visible="formVisible" header="添加" :width="646" placement="center" :footer="false">
<template #body>
<t-radio-group v-model="selectWay" variant="default-filled">
<t-radio-button value="add-single">订阅配置</t-radio-button>
<t-radio-button value="add-file">文件导入</t-radio-button>
<t-radio-button value="add-api">源站接口</t-radio-button>
</t-radio-group>
<div class="t-radio-group__header">
<t-radio-group v-model="selectWay" variant="default-filled" size="small">
<t-radio-button value="add-single">订阅配置</t-radio-button>
<t-radio-button value="add-file">文件导入</t-radio-button>
<t-radio-button value="add-api">源站接口</t-radio-button>
</t-radio-group>
</div>

<!-- 表单内容-单个添加 -->
<t-form
Expand Down
39 changes: 3 additions & 36 deletions src/pages/setting/base/BaseSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<t-radio-group v-model="formData.defaultHot">
<t-radio value="kuyun">酷云(旧)</t-radio>
<t-radio value="kylive">酷云(新)</t-radio>
<t-radio value="enlightent">云合</t-radio>
<t-radio value="enlightent">云合数据</t-radio>
</t-radio-group>
</div>
</t-form-item>
Expand Down Expand Up @@ -71,19 +71,6 @@
</t-space>
</div>
</t-form-item>
<t-form-item label="过滤" name="filter">
<div class="filter">
<t-space>
<span class="title" @click="classEvent('main')">主要分类</span>
<span class="title" @click="classEvent('r18')">青少年模式</span>
</t-space>
<dialog-class-view
v-model:visible="isClassDialog"
:data="classDialogData"
@receive-class-data="flushDialogData"
/>
</div>
</t-form-item>
<t-form-item label="直播" name="iptv">
<div class="iptv">
<t-space>
Expand Down Expand Up @@ -165,7 +152,6 @@ import db from '@/lib/dexie/dexie';
import zy from '@/lib/utils/tools';
import { usePlayStore, useSettingStore } from '@/store';
import DialogClassView from './components/DialogClass.vue';
import DialogClearView from './components/DialogClear.vue';
import DialogDnsView from './components/DialogDns.vue';
import DialogEasyConfigView from './components/DialogEasyConfig.vue';
Expand All @@ -179,8 +165,6 @@ const win = remote.getCurrentWindow();
const { platform } = process;
const isClassDialog = ref(false);
const classDialogData = ref({ data: [], type: 'rootClassFilter' });
const isEasyConfigDialog = ref(false);
const isUpdateDialog = ref(false);
const isDnsDialog = ref(false);
Expand Down Expand Up @@ -241,6 +225,8 @@ watch(
formData.value.defaultSearchType,
formData.value.defaultChangeModel,
formData.value.defaultCheckModel,
formData.value.defaultSearchRecommend,
formData.value.defaultSearchType,
],
(_, oldValue) => {
if (oldValue.every((item) => typeof item !== 'undefined')) {
Expand Down Expand Up @@ -541,25 +527,6 @@ const easyConfig = () => {
isEasyConfigDialog.value = true;
};
// 分类:打开dialog并设置数据
const classEvent = (item) => {
switch (item) {
case 'r18':
classDialogData.value = {
data: [...formData.value.r18ClassFilter],
type: 'r18ClassFilter',
};
break;
default:
classDialogData.value = {
data: [...formData.value.rootClassFilter],
type: 'rootClassFilter',
};
break;
}
isClassDialog.value = true;
};
// dns:打开dialog并设置数据
const dnsEvnet = () => {
const { dns } = formData.value;
Expand Down
14 changes: 7 additions & 7 deletions src/pages/setting/iptv/components/DialogAdd.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<template>
<t-dialog v-model:visible="formVisible" header="添加" :width="646" placement="center" :footer="false">
<template #body>
<t-radio-group v-model="selectWay" variant="default-filled">
<t-radio-button value="add-single">订阅配置</t-radio-button>
<t-radio-button value="add-file">文件导入</t-radio-button>
<t-radio-button value="add-api">源站接口</t-radio-button>
</t-radio-group>
<div class="t-radio-group__header">
<t-radio-group v-model="selectWay" variant="default-filled" size="small">
<t-radio-button value="add-single">订阅配置</t-radio-button>
<t-radio-button value="add-file">文件导入</t-radio-button>
<t-radio-button value="add-api">源站接口</t-radio-button>
</t-radio-group>
</div>

<!-- 表单内容-单个添加 -->
<t-form
Expand Down Expand Up @@ -280,8 +282,6 @@ const urlEvent = async (url) => {
};
</script>
<style lang="less" scoped>
@import '@/style/variables.less';
.input-item,
:deep(.t-upload__dragger) {
width: calc(480px - var(--td-size-1));
Expand Down
33 changes: 16 additions & 17 deletions src/pages/setting/site/components/DialogAdd.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<template>
<t-dialog v-model:visible="formVisible" header="添加" :width="646" placement="center" :footer="false">
<t-dialog v-model:visible="formVisible" header="添加" :width="700" placement="center" :footer="false">
<template #body>
<t-radio-group v-model="selectWay" variant="default-filled">
<t-radio-button value="add-single">订阅配置</t-radio-button>
<t-radio-button value="add-file">文件导入</t-radio-button>
<t-radio-button value="add-api">源站接口</t-radio-button>
</t-radio-group>
<div class="t-radio-group__header">
<t-radio-group v-model="selectWay" variant="default-filled" size="small">
<t-radio-button value="add-single">订阅配置</t-radio-button>
<t-radio-button value="add-file">文件导入</t-radio-button>
<t-radio-button value="add-api">源站接口</t-radio-button>
</t-radio-group>
</div>

<!-- 表单内容-单个添加 -->
<t-form
Expand All @@ -17,7 +19,7 @@
@submit="onSubmit($event, 'single')"
>
<t-form-item label="名称" name="name">
<t-input v-model="formData.siteInfo.name" class="input-item" placeholder="请输入内容" />
<t-input v-model="formData.siteInfo.name" placeholder="请输入内容" />
</t-form-item>
<t-form-item label="类型" name="type">
<t-radio-group v-model="formData.siteInfo.type">
Expand All @@ -31,7 +33,7 @@
</t-radio-group>
</t-form-item>
<t-form-item label="接口" name="api">
<t-input v-model="formData.siteInfo.api" class="input-item" placeholder="请输入内容" />
<t-input v-model="formData.siteInfo.api" placeholder="请输入内容" />
</t-form-item>
<t-form-item label="搜索" name="search">
<t-radio-group v-model="formData.siteInfo.search">
Expand All @@ -41,18 +43,17 @@
</t-radio-group>
</t-form-item>
<!-- <t-form-item label="下载" name="download">
<t-input v-model="formData.siteInfo.download" class="input-item" placeholder="请输入内容" />
<t-input v-model="formData.siteInfo.download" placeholder="请输入内容" />
</t-form-item> -->
<t-form-item label="解析" name="playUrl">
<t-input v-model="formData.siteInfo.playUrl" class="input-item" placeholder="请输入内容" />
<t-input v-model="formData.siteInfo.playUrl" placeholder="请输入内容" />
</t-form-item>
<t-form-item label="分组" name="type">
<t-select
v-model="formData.siteInfo.group"
creatable
filterable
placeholder="请选择分组"
class="input-item"
@create="createOptions"
>
<t-option
Expand All @@ -64,8 +65,8 @@
/>
</t-select>
</t-form-item>
<t-form-item label="标识" name="key">
<t-input v-model="formData.siteInfo.key" class="input-item" placeholder="请输入内容" />
<t-form-item label="类别" name="categories">
<t-input v-model="formData.siteInfo.categories" placeholder="请输入内容,逗号分隔" />
</t-form-item>
<div class="optios">
<t-form-item style="float: right">
Expand Down Expand Up @@ -110,7 +111,7 @@
@submit="onSubmit($event, 'api')"
>
<t-form-item label="接口地址" name="sitesDataURL">
<t-input v-model="formData.url.sitesDataURL" class="input-item" placeholder="请输入接口url" />
<t-input v-model="formData.url.sitesDataURL" placeholder="请输入接口url" />
</t-form-item>
<div class="optios">
<t-form-item style="float: right">
Expand Down Expand Up @@ -329,10 +330,8 @@ const createOptions = (val) => {
</script>

<style lang="less" scoped>
@import '@/style/variables.less';
.input-item,
:deep(.t-upload__dragger) {
width: calc(480px - var(--td-size-1));
width: calc(532px - var(--td-size-1));
}
</style>
6 changes: 3 additions & 3 deletions src/pages/setting/site/components/DialogEdit.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<t-dialog v-model:visible="formVisible" header="编辑" :width="680" placement="center" :footer="false">
<t-dialog v-model:visible="formVisible" header="编辑" :width="700" placement="center" :footer="false">
<template #body>
<!-- 表单内容 -->
<t-form ref="form" colon :data="formData" :rules="rules" :label-width="100" @submit="onSubmit">
Expand Down Expand Up @@ -51,8 +51,8 @@
/>
</t-select>
</t-form-item>
<t-form-item label="标识" name="key">
<t-input v-model="formData.key" placeholder="请输入内容" />
<t-form-item label="类别" name="categories">
<t-input v-model="formData.categories" placeholder="请输入内容,逗号分隔" />
</t-form-item>

<div class="optios">
Expand Down
7 changes: 6 additions & 1 deletion src/style/layout.less
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,13 @@
}

.t-dialog--default {
.t-dialog__body{
.t-dialog__body {
padding: var(--td-comp-paddingTB-l) var(--td-size-1) 0 var(--td-size-1);
.t-radio-group__header {
position: absolute;
left: calc(var(--td-comp-paddingLR-xxl) + 40px);
top: calc(var(--td-comp-paddingTB-xxl) - 0.1rem);
}
.t-form__item {
margin-bottom: var(--td-comp-margin-l);
}
Expand Down
3 changes: 1 addition & 2 deletions src/types/dexie.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ interface Setting {
theme: string;
externalPlayer: string;
recordShortcut: string;
rootClassFilter: string[];
r18ClassFilter: string[];
defaultHot: string;
defaultSearchRecommend: string;
defaultSearchType: string;
Expand Down Expand Up @@ -54,6 +52,7 @@ interface Site {
isActive: boolean;
group: string;
resource: number | null;
categories: string | null;
}

interface History {
Expand Down

0 comments on commit 4fca9d9

Please sign in to comment.