This commit is contained in:
jxxghp
2024-01-01 20:06:37 +08:00
parent 750f4bc276
commit 0eb5d607bf
6 changed files with 93 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "moviepilot", "name": "moviepilot",
"version": "1.5.5", "version": "1.5.6",
"private": true, "private": true,
"bin": "dist/service.js", "bin": "dist/service.js",
"scripts": { "scripts": {
+33 -1
View File
@@ -33,7 +33,7 @@ export function isToday(date: Date) {
) )
} }
// 计算时间差,返回xx天xx小时xx分钟 // 计算时间差,返回xx天/xx小时/xx分钟/xx秒
export function calculateTimeDifference(inputTime: string): string { export function calculateTimeDifference(inputTime: string): string {
if (!inputTime) if (!inputTime)
return '' return ''
@@ -64,6 +64,38 @@ export function calculateTimeDifference(inputTime: string): string {
} }
} }
// 计算时间差,返回xx天xx小时xx分钟
export function calculateTimeDiff(inputTime: string): string {
if (!inputTime)
return ''
// 使用当前时区
const inputDate = new Date(inputTime)
const currentDate = new Date()
const timeDifference = currentDate.getTime() - inputDate.getTime()
const secondsDifference = Math.floor(timeDifference / 1000)
const days = Math.floor(secondsDifference / 86400)
const hours = Math.floor(secondsDifference % 86400 / 3600)
const minutes = Math.floor(secondsDifference % 86400 % 3600 / 60)
const secones = Math.floor(secondsDifference % 60)
if (days > 0)
return `${days}${hours}小时${minutes}分钟`
else if (hours > 0)
return `${hours}小时${minutes}分钟`
else if (minutes > 0)
return `${minutes}分钟`
else if (secones > 0)
return `${secones}`
return ''
}
// 判断一个数组subArray是不是在另一个数组mainArray中 // 判断一个数组subArray是不是在另一个数组mainArray中
export function isContained(subArray: any[], mainArray: any[]): boolean { export function isContained(subArray: any[], mainArray: any[]): boolean {
return subArray.every(element => mainArray.includes(element)) return subArray.every(element => mainArray.includes(element))
+7
View File
@@ -651,6 +651,13 @@ export interface TorrentInfo {
// 促销描述 // 促销描述
volume_factor: string volume_factor: string
// 免费时间
freedate: string
// 剩余免费时间
freedate_diff: string
} }
// 识别元数据 // 识别元数据
+17
View File
@@ -412,6 +412,23 @@ onMounted(() => {
<div class="text-sm my-1"> <div class="text-sm my-1">
{{ item.raw.description }} {{ item.raw.description }}
</div> </div>
<VChip
v-if="item.raw?.hit_and_run"
variant="elevated"
size="small"
class="me-1 mb-1 text-white bg-black"
>
H&R
</VChip>
<VChip
v-if="item.raw?.freedate_diff"
variant="elevated"
color="secondary"
size="small"
class="me-1 mb-1"
>
{{ item.raw?.freedate_diff }}
</VChip>
<VChip <VChip
v-for="(label, index) in item.raw?.labels" v-for="(label, index) in item.raw?.labels"
:key="index" :key="index"
+17
View File
@@ -195,6 +195,23 @@ onMounted(() => {
v-if="torrent?.labels" v-if="torrent?.labels"
class="pb-3 pt-0 pe-12" class="pb-3 pt-0 pe-12"
> >
<VChip
v-if="torrent?.hit_and_run"
variant="elevated"
size="small"
class="me-1 mb-1 text-white bg-black"
>
H&R
</VChip>
<VChip
v-if="torrent?.freedate_diff"
variant="elevated"
color="secondary"
size="small"
class="me-1 mb-1"
>
{{ torrent?.freedate_diff }}
</VChip>
<VChip <VChip
v-for="(label, index) in torrent?.labels" v-for="(label, index) in torrent?.labels"
:key="index" :key="index"
+17
View File
@@ -150,6 +150,23 @@ onMounted(() => {
v-if="torrent?.labels" v-if="torrent?.labels"
class="pt-2" class="pt-2"
> >
<VChip
v-if="torrent?.hit_and_run"
variant="elevated"
size="small"
class="me-1 mb-1 text-white bg-black"
>
H&R
</VChip>
<VChip
v-if="torrent?.freedate_diff"
variant="elevated"
color="secondary"
size="small"
class="me-1 mb-1"
>
{{ torrent?.freedate_diff }}
</VChip>
<VChip <VChip
v-for="(label, index) in torrent?.labels" v-for="(label, index) in torrent?.labels"
:key="index" :key="index"