mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Support original username (fix #1208)
This commit is contained in:
parent
3de3b9eec0
commit
99cb09c657
@ -1,4 +1,4 @@
|
|||||||
import { FeedsCard, addMenuItem, forEachFeedsCard } from '@/components/feeds/api'
|
import { FeedsCard, addMenuItem, forEachFeedsCard, RepostFeedsCard } from '@/components/feeds/api'
|
||||||
import { ComponentEntry } from '@/components/types'
|
import { ComponentEntry } from '@/components/types'
|
||||||
import { getBlob } from '@/core/ajax'
|
import { getBlob } from '@/core/ajax'
|
||||||
import { DownloadPackage } from '@/core/download'
|
import { DownloadPackage } from '@/core/download'
|
||||||
@ -42,6 +42,7 @@ export const setupFeedImageExporter: ComponentEntry = async ({ settings: { optio
|
|||||||
const titleData = {
|
const titleData = {
|
||||||
user: card.username,
|
user: card.username,
|
||||||
id: card.id,
|
id: card.id,
|
||||||
|
originalUser: (card as RepostFeedsCard).repostUsername ?? card.username,
|
||||||
n: (index + 1).toString(),
|
n: (index + 1).toString(),
|
||||||
}
|
}
|
||||||
pack.add(`${formatTitle(feedFormat, false, titleData)}${imageUrls[index].extension}`, blob)
|
pack.add(`${formatTitle(feedFormat, false, titleData)}${imageUrls[index].extension}`, blob)
|
||||||
@ -50,6 +51,7 @@ export const setupFeedImageExporter: ComponentEntry = async ({ settings: { optio
|
|||||||
const packTitleData = {
|
const packTitleData = {
|
||||||
user: card.username,
|
user: card.username,
|
||||||
id: card.id,
|
id: card.id,
|
||||||
|
originalUser: (card as RepostFeedsCard).repostUsername ?? card.username,
|
||||||
n: '',
|
n: '',
|
||||||
}
|
}
|
||||||
await pack.emit(`${formatTitle(feedFormat, false, packTitleData)}.zip`)
|
await pack.emit(`${formatTitle(feedFormat, false, packTitleData)}.zip`)
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
动态文件名变量:
|
动态文件名变量:
|
||||||
- `user`: 用户名
|
- `user`: 用户名
|
||||||
|
- `originalUser`: 被转发用户名, 如果不是转发类型的动态则等于 `user`
|
||||||
- `id`: 动态 ID
|
- `id`: 动态 ID
|
||||||
- `n`: 第 n 张图
|
- `n`: 第 n 张图
|
||||||
|
|
||||||
@ -2,14 +2,10 @@ import { ComponentMetadata } from '@/components/types'
|
|||||||
import { matchUrlPattern } from '@/core/utils'
|
import { matchUrlPattern } from '@/core/utils'
|
||||||
import { columnUrls, feedsUrls } from '@/core/utils/urls'
|
import { columnUrls, feedsUrls } from '@/core/utils/urls'
|
||||||
import { setupFeedImageExporter } from './feed'
|
import { setupFeedImageExporter } from './feed'
|
||||||
import desc from './desc.md'
|
|
||||||
|
|
||||||
export const component: ComponentMetadata = {
|
export const component: ComponentMetadata = {
|
||||||
name: 'imageExporter',
|
name: 'imageExporter',
|
||||||
displayName: '图片批量导出',
|
displayName: '图片批量导出',
|
||||||
description: {
|
|
||||||
'zh-CN': desc,
|
|
||||||
},
|
|
||||||
tags: [
|
tags: [
|
||||||
componentsTags.feeds,
|
componentsTags.feeds,
|
||||||
componentsTags.utils,
|
componentsTags.utils,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user