This commit is contained in:
syuilo 2019-01-19 09:52:27 +09:00
parent 0d456b151f
commit 71fa5a1d77

View file

@ -48,7 +48,7 @@ export default define(meta, (ps, user) => new Promise(async (res, rej) => {
} else if (ps.url) { } else if (ps.url) {
const isInternalStorageUrl = ps.url.startsWith(config.drive_url); const isInternalStorageUrl = ps.url.startsWith(config.drive_url);
if (isInternalStorageUrl) { if (isInternalStorageUrl) {
// Extract file if from url // Extract file ID from url
// e.g. // e.g.
// http://misskey.local/files/foo?original=bar --> foo // http://misskey.local/files/foo?original=bar --> foo
const fileId = new mongo.ObjectID(ps.url.replace(config.drive_url, '').replace(/\?(.*)$/, '').replace(/\//g, '')); const fileId = new mongo.ObjectID(ps.url.replace(config.drive_url, '').replace(/\?(.*)$/, '').replace(/\//g, ''));