Skip to content

Commit

Permalink
Fix preview problem
Browse files Browse the repository at this point in the history
  • Loading branch information
danimal141 committed Feb 26, 2024
1 parent d6275d4 commit fa56a7f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/dropbox/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default class DbxAdapter {
static readonly TARGET_FILE_LIMIT = 5;
static readonly ASSET_FILE_LIMIT = 100;
static readonly REVIVE_FILE_LIMIT = 100;
// static readonly DL_DROPBOX_URL_BASE = "https://dl.dropboxusercontent.com";
static readonly DL_DROPBOX_URL_BASE = "https://dl.dropboxusercontent.com";

private client: Dropbox;
private rootPath: string;
Expand All @@ -32,13 +32,13 @@ export default class DbxAdapter {
return created.result.url;
})
);
return links;
// return compact(links).map((link) => {
// const path = new URL(link).pathname;
// // convert the direct link
// // "www.dropbox.com" -> "dl.dropboxusercontent.com" / strip "?dl=0"
// return DbxAdapter.DL_DROPBOX_URL_BASE + path;
// });
return compact(links).map((link) => {
const url = new URL(link);
const path = url.pathname + url.search;
// convert the direct link
// "www.dropbox.com" -> "dl.dropboxusercontent.com"
return DbxAdapter.DL_DROPBOX_URL_BASE + path;
});
}

public async evacuateRelearnedFiles(paths: string[]): Promise<number> {
Expand Down

0 comments on commit fa56a7f

Please sign in to comment.