mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-24 05:23:08 +02:00
Some import and export fixes (#4842)
* Fix: Mastodon v2.8.0 のフォローリストがインポートできない * Fix: エクスポートリクエストに失敗してもエラーが出ない (#4821) * エクスポートファイルでは同一ハッシュチェックをしないように
This commit is contained in:
parent
a09a3465a2
commit
9d1ed1eb0d
7 changed files with 18 additions and 12 deletions
|
@ -290,12 +290,17 @@ export default Vue.extend({
|
|||
this.exportTarget == 'mute' ? 'i/export-mute' :
|
||||
this.exportTarget == 'blocking' ? 'i/export-blocking' :
|
||||
this.exportTarget == 'user-lists' ? 'i/export-user-lists' :
|
||||
null, {});
|
||||
|
||||
this.$root.dialog({
|
||||
type: 'info',
|
||||
text: this.$t('export-requested')
|
||||
});
|
||||
null, {}).then(() => {
|
||||
this.$root.dialog({
|
||||
type: 'info',
|
||||
text: this.$t('export-requested')
|
||||
});
|
||||
}).catch((e: any) => {
|
||||
this.$root.dialog({
|
||||
type: 'error',
|
||||
text: e.message
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
doImport() {
|
||||
|
|
|
@ -85,7 +85,7 @@ export async function exportBlocking(job: Bull.Job, done: any): Promise<void> {
|
|||
logger.succ(`Exported to: ${path}`);
|
||||
|
||||
const fileName = 'blocking-' + dateFormat(new Date(), 'yyyy-mm-dd-HH-MM-ss') + '.csv';
|
||||
const driveFile = await addFile(user, path, fileName);
|
||||
const driveFile = await addFile(user, path, fileName, null, null, true);
|
||||
|
||||
logger.succ(`Exported to: ${driveFile.id}`);
|
||||
cleanup();
|
||||
|
|
|
@ -85,7 +85,7 @@ export async function exportFollowing(job: Bull.Job, done: any): Promise<void> {
|
|||
logger.succ(`Exported to: ${path}`);
|
||||
|
||||
const fileName = 'following-' + dateFormat(new Date(), 'yyyy-mm-dd-HH-MM-ss') + '.csv';
|
||||
const driveFile = await addFile(user, path, fileName);
|
||||
const driveFile = await addFile(user, path, fileName, null, null, true);
|
||||
|
||||
logger.succ(`Exported to: ${driveFile.id}`);
|
||||
cleanup();
|
||||
|
|
|
@ -85,7 +85,7 @@ export async function exportMute(job: Bull.Job, done: any): Promise<void> {
|
|||
logger.succ(`Exported to: ${path}`);
|
||||
|
||||
const fileName = 'mute-' + dateFormat(new Date(), 'yyyy-mm-dd-HH-MM-ss') + '.csv';
|
||||
const driveFile = await addFile(user, path, fileName);
|
||||
const driveFile = await addFile(user, path, fileName, null, null, true);
|
||||
|
||||
logger.succ(`Exported to: ${driveFile.id}`);
|
||||
cleanup();
|
||||
|
|
|
@ -108,7 +108,7 @@ export async function exportNotes(job: Bull.Job, done: any): Promise<void> {
|
|||
logger.succ(`Exported to: ${path}`);
|
||||
|
||||
const fileName = 'notes-' + dateFormat(new Date(), 'yyyy-mm-dd-HH-MM-ss') + '.json';
|
||||
const driveFile = await addFile(user, path, fileName);
|
||||
const driveFile = await addFile(user, path, fileName, null, null, true);
|
||||
|
||||
logger.succ(`Exported to: ${driveFile.id}`);
|
||||
cleanup();
|
||||
|
|
|
@ -62,7 +62,7 @@ export async function exportUserLists(job: Bull.Job, done: any): Promise<void> {
|
|||
logger.succ(`Exported to: ${path}`);
|
||||
|
||||
const fileName = 'user-lists-' + dateFormat(new Date(), 'yyyy-mm-dd-HH-MM-ss') + '.csv';
|
||||
const driveFile = await addFile(user, path, fileName);
|
||||
const driveFile = await addFile(user, path, fileName, null, null, true);
|
||||
|
||||
logger.succ(`Exported to: ${driveFile.id}`);
|
||||
cleanup();
|
||||
|
|
|
@ -35,7 +35,8 @@ export async function importFollowing(job: Bull.Job, done: any): Promise<void> {
|
|||
linenum++;
|
||||
|
||||
try {
|
||||
const { username, host } = parseAcct(line.trim());
|
||||
const acct = line.split(',')[0].trim();
|
||||
const { username, host } = parseAcct(acct);
|
||||
|
||||
let target = isSelfHost(host!) ? await Users.findOne({
|
||||
host: null,
|
||||
|
|
Loading…
Reference in a new issue