-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OriginalSource 系のサムネイル画像周りを修正 (#1056)
* OriginalSource 系のサムネイル画像周り Fixes #1054 * fx
- Loading branch information
Showing
16 changed files
with
125 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
type BilibiliOriginalSource { | ||
sourceId: String! | ||
|
||
title: String! | ||
url: String! | ||
|
||
"プロキシされた画像URL" | ||
thumbnailUrl(scale: FetchExternalSourceThumbnailScale! = LARGE): String! | ||
@deprecated(reason: "Use `proxiedThumbnailUrl`") | ||
|
||
"プロキシされた画像URL" | ||
proxiedThumbnailUrl(scale: FetchExternalSourceThumbnailScale! = LARGE): String! | ||
|
||
""" | ||
bilibili側のオリジナルの画像URL | ||
bilibili側の制約上、別のオリジンから直接埋め込んだりすることはほとんど出来ないことに注意. | ||
""" | ||
originalThumbnailUrl: String! | ||
|
||
tags: [BilibiliOriginalSourceTag!]! | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
type BilibiliOriginalSourceTag { | ||
name: String! | ||
searchTags(input: BilibiliOriginalSourceTagSearchTagsInput!): BilibiliOriginalSourceTagSearchTagsPayload! | ||
} | ||
|
||
input BilibiliOriginalSourceTagSearchTagsInput { | ||
limit: Int! = 3 | ||
skip: Int! = 0 | ||
} | ||
|
||
type BilibiliOriginalSourceTagSearchTagsPayload { | ||
items: [TagSearchItemByName!]! | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
export class YoutubeOriginalSourceDTO { | ||
private constructor( | ||
private readonly source: { | ||
sourceId: string; | ||
url: string; | ||
originalThumbnailUrl: string; | ||
}, | ||
) {} | ||
|
||
public static make({ | ||
sourceId, | ||
url, | ||
originalThumbnailUrl, | ||
}: { | ||
sourceId: string; | ||
url: string; | ||
originalThumbnailUrl: string; | ||
}) { | ||
return new YoutubeOriginalSourceDTO({ sourceId, url, originalThumbnailUrl }); | ||
} | ||
|
||
get sourceId() { | ||
return this.source.sourceId; | ||
} | ||
|
||
get url() { | ||
return this.source.url; | ||
} | ||
|
||
get originalThumbnailUrl() { | ||
return this.source.originalThumbnailUrl; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
type YoutubeOriginalSource { | ||
sourceId: String! | ||
url: String! | ||
|
||
thumbnailUrl: String! @deprecated(reason: "Use `originalThumbnailUrl`") | ||
originalThumbnailUrl: String! | ||
|
||
proxiedThumbnailUrl(scale: FetchExternalSourceThumbnailScale! = LARGE): String! | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { MkResolver } from "../utils/MkResolver.js"; | ||
|
||
export const mkYoutubeOriginalSourceResolver: MkResolver<"YoutubeOriginalSource", "ImagesService"> = ({ | ||
ImagesService, | ||
}) => { | ||
return { | ||
sourceId: ({ sourceId }) => sourceId, | ||
url: ({ sourceId }) => `https://www.nicovideo.jp/watch/${sourceId}`, | ||
thumbnailUrl: ({ originalThumbnailUrl }) => originalThumbnailUrl, | ||
originalThumbnailUrl: ({ originalThumbnailUrl }) => originalThumbnailUrl, | ||
proxiedThumbnailUrl: ({ originalThumbnailUrl }, { scale }) => ImagesService.proxyThis(originalThumbnailUrl, scale), | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters