From 9aa0079ba60fa52323d1d702babee81870ddd694 Mon Sep 17 00:00:00 2001 From: Zach Leatherman Date: Wed, 20 Nov 2024 14:58:04 -0600 Subject: [PATCH] Fix issue with @ bluesky usernames --- src/DataSource/BlueskyUser.js | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/DataSource/BlueskyUser.js b/src/DataSource/BlueskyUser.js index 53d56f9..176136f 100644 --- a/src/DataSource/BlueskyUser.js +++ b/src/DataSource/BlueskyUser.js @@ -5,23 +5,15 @@ class BlueskyUser extends Rss { static TYPE = "bluesky"; static TYPE_FRIENDLY = "Bluesky"; - #username; - - constructor(username) { - super(`https://bsky.app/profile/${username}/rss`); - this.username = username; - } - - set username(username) { + static normalizeUsername(username) { if(username.startsWith("@")) { - this.#username = username.slice(1); - } else { - this.#username = username; + return username.slice(1); } + return username; } - get username() { - return this.#username; + constructor(username) { + super(`https://bsky.app/profile/${BlueskyUser.normalizeUsername(username)}/rss`); } static getFilePath(url) {