Merge branch 'develop' into fix/channel-following-list
This commit is contained in:
		
						commit
						a5cc87fd21
					
				|  | @ -10,6 +10,7 @@ | |||
| - Fix: Play作成時に設定した公開範囲が機能していない問題を修正 | ||||
| 
 | ||||
| ### Client | ||||
| - Feat: アップロードするファイルの名前をランダム文字列にできるように | ||||
| - Enhance: 自分のノートの添付ファイルから直接ファイルの詳細ページに飛べるように | ||||
| - Enhance: 広告がMisskeyと同一ドメインの場合はRouterで遷移するように | ||||
| - Enhance: リアクション・いいねの総数を表示するように | ||||
|  |  | |||
|  | @ -4936,6 +4936,14 @@ export interface Locale extends ILocale { | |||
|      * 動画・音声の再生にブラウザのUIを使用する | ||||
|      */ | ||||
|     "useNativeUIForVideoAudioPlayer": string; | ||||
|     /** | ||||
|      * オリジナルのファイル名を保持 | ||||
|      */ | ||||
|     "keepOriginalFilename": string; | ||||
|     /** | ||||
|      * この設定をオフにすると、アップロード時にファイル名が自動でランダム文字列に置き換えられます。 | ||||
|      */ | ||||
|     "keepOriginalFilenameDescription": string; | ||||
|     "_bubbleGame": { | ||||
|         /** | ||||
|          * 遊び方 | ||||
|  |  | |||
|  | @ -1230,6 +1230,8 @@ useTotp: "ワンタイムパスワードを使う" | |||
| useBackupCode: "バックアップコードを使う" | ||||
| launchApp: "アプリを起動" | ||||
| useNativeUIForVideoAudioPlayer: "動画・音声の再生にブラウザのUIを使用する" | ||||
| keepOriginalFilename: "オリジナルのファイル名を保持" | ||||
| keepOriginalFilenameDescription: "この設定をオフにすると、アップロード時にファイル名が自動でランダム文字列に置き換えられます。" | ||||
| 
 | ||||
| _bubbleGame: | ||||
|   howToPlay: "遊び方" | ||||
|  |  | |||
|  | @ -44,6 +44,10 @@ SPDX-License-Identifier: AGPL-3.0-only | |||
| 				<template #label>{{ i18n.ts.keepOriginalUploading }}</template> | ||||
| 				<template #caption>{{ i18n.ts.keepOriginalUploadingDescription }}</template> | ||||
| 			</MkSwitch> | ||||
| 			<MkSwitch v-model="keepOriginalFilename"> | ||||
| 				<template #label>{{ i18n.ts.keepOriginalFilename }}</template> | ||||
| 				<template #caption>{{ i18n.ts.keepOriginalFilenameDescription }}</template> | ||||
| 			</MkSwitch> | ||||
| 			<MkSwitch v-model="alwaysMarkNsfw" @update:modelValue="saveProfile()"> | ||||
| 				<template #label>{{ i18n.ts.alwaysMarkSensitive }}</template> | ||||
| 			</MkSwitch> | ||||
|  | @ -96,6 +100,7 @@ const meterStyle = computed(() => { | |||
| }); | ||||
| 
 | ||||
| const keepOriginalUploading = computed(defaultStore.makeGetterSetter('keepOriginalUploading')); | ||||
| const keepOriginalFilename = computed(defaultStore.makeGetterSetter('keepOriginalFilename')); | ||||
| 
 | ||||
| misskeyApi('drive').then(info => { | ||||
| 	capacity.value = info.capacity; | ||||
|  |  | |||
|  | @ -5,6 +5,7 @@ | |||
| 
 | ||||
| import { reactive, ref } from 'vue'; | ||||
| import * as Misskey from 'misskey-js'; | ||||
| import { v4 as uuid } from 'uuid'; | ||||
| import { readAndCompressImage } from '@misskey-dev/browser-image-resizer'; | ||||
| import { getCompressionConfig } from './upload/compress-config.js'; | ||||
| import { defaultStore } from '@/store.js'; | ||||
|  | @ -39,13 +40,16 @@ export function uploadFile( | |||
| 	if (folder && typeof folder === 'object') folder = folder.id; | ||||
| 
 | ||||
| 	return new Promise((resolve, reject) => { | ||||
| 		const id = Math.random().toString(); | ||||
| 		const id = uuid(); | ||||
| 
 | ||||
| 		const reader = new FileReader(); | ||||
| 		reader.onload = async (): Promise<void> => { | ||||
| 			const filename = name ?? file.name ?? 'untitled'; | ||||
| 			const extension = filename.split('.').length > 1 ? '.' + filename.split('.').pop() : ''; | ||||
| 
 | ||||
| 			const ctx = reactive<Uploading>({ | ||||
| 				id: id, | ||||
| 				name: name ?? file.name ?? 'untitled', | ||||
| 				id, | ||||
| 				name: defaultStore.state.keepOriginalFilename ? filename : id + extension, | ||||
| 				progressMax: undefined, | ||||
| 				progressValue: undefined, | ||||
| 				img: window.URL.createObjectURL(file), | ||||
|  |  | |||
|  | @ -446,6 +446,10 @@ export const defaultStore = markRaw(new Storage('base', { | |||
| 		where: 'device', | ||||
| 		default: false, | ||||
| 	}, | ||||
| 	keepOriginalFilename: { | ||||
| 		where: 'device', | ||||
| 		default: true, | ||||
| 	}, | ||||
| 
 | ||||
| 	sound_masterVolume: { | ||||
| 		where: 'device', | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue