From 2f0f931b1a2d13d32a05f62fc7e5f14fd8714ecd Mon Sep 17 00:00:00 2001 From: izzy Date: Sun, 31 Aug 2025 18:02:16 +0200 Subject: [PATCH] refactor: support new Autumn url scheme --- src/classes/File.ts | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/classes/File.ts b/src/classes/File.ts index 21767c02..fd3fb652 100644 --- a/src/classes/File.ts +++ b/src/classes/File.ts @@ -59,19 +59,30 @@ export class File { /** * Direct URL to the file */ - get url(): string { - return `${this.#client.configuration?.features.autumn.url}/${this.tag}/${ - this.id - }/${this.filename}`; + // get url(): string { + // if (!this.filename) return this.previewUrl; + // + // return `${this.#client.configuration?.features.autumn.url}/${this.tag}/${ + // this.id + // }/${this.filename}`; + // } + + /** + * Preview URL for the file + */ + get previewUrl(): string { + return `${this.#client.configuration?.features.autumn.url}/${ + this.tag + }/${this.id}`; } /** - * Download URL for the file + * Original download URL for the file */ - get downloadURL(): string { + get originalUrl(): string { return `${this.#client.configuration?.features.autumn.url}/${ this.tag - }/download/${this.id}/${this.filename}`; + }/${this.id}/original`; } /**