From a747911df8913854afe369eb9488bd75e5033be2 Mon Sep 17 00:00:00 2001 From: evazion Date: Wed, 16 Nov 2022 21:27:06 -0600 Subject: [PATCH] foundation: fix `foundation.app/@name/~/$id` type URLs. Fix URLs like this not working: https://foundation.app/@mochiiimo/~/97376 The correct URL is now: https://foundation.app/@mochiiimo/foundation/97376 --- app/logical/source/url/foundation.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/logical/source/url/foundation.rb b/app/logical/source/url/foundation.rb index 40e429af0..f54dfb8fa 100644 --- a/app/logical/source/url/foundation.rb +++ b/app/logical/source/url/foundation.rb @@ -30,6 +30,11 @@ class Source::URL::Foundation < Source::URL @user_id = user_id # https://foundation.app/@mochiiimo/~/97376 + in "foundation.app", /^@/ => username, "~", /^\d+/ => work_id + @username = username.delete_prefix("@") + @collection = "foundation" + @work_id = work_id + # https://foundation.app/@mochiiimo/foundation/97376 # https://foundation.app/@KILLERGF/kgfgen/4 in "foundation.app", /^@/ => username, collection, /^\d+/ => work_id