commit f57780c0c47216a82c5940b267eb166b9cd4e060
parent 8fb661891ab4fd4a669d0af97ab150ab333050db
Author: mtmn <miro@haravara.org>
Date: Sun, 3 May 2026 00:49:59 +0200
feat: change ua links to sourcehut
Diffstat:
5 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/Cosine.purs b/src/Cosine.purs
@@ -43,7 +43,7 @@ fetchCosineSimilar slug cfg query = do
liftEffect $ Metrics.incCosineRequest slug "not_configured"
pure "{\"data\":{\"similar_tracks\":[]},\"success\":true}"
else do
- let headers = { "User-Agent": "corpus/1.0 +https://github.com/mtmn/corpus", "Authorization": "Bearer " <> apiKey }
+ let headers = { "User-Agent": "corpus/1.0 +https://sr.ht/~mtmn/corpus", "Authorization": "Bearer " <> apiKey }
let searchUrl = "https://cosine.club/api/v1/search?q=" <> (fromMaybe "" $ encodeURIComponent query) <> "&limit=1"
Log.info $ "Cosine Club: searching for: " <> query
searchResult <- try $ fetch searchUrl { method: GET, headers: headers }
diff --git a/src/Cover.purs b/src/Cover.purs
@@ -61,7 +61,7 @@ getQueryParam key url = URLSearchParams.get key (URL.searchParams url)
fetchCaaCoverUrl :: String -> Aff (Maybe String)
fetchCaaCoverUrl mbid = do
let url = "https://coverartarchive.org/release/" <> mbid
- let headers = { "User-Agent": "corpus/1.0 (+https://github.com/mtmn/corpus)" }
+ let headers = { "User-Agent": "corpus/1.0 (+https://sr.ht/~mtmn/corpus)" }
result <- try $ fetch url { method: GET, headers }
case result of
Right fr | fr.status == 200 -> do
@@ -96,7 +96,7 @@ fetchLastfmCoverUrl cfg artist release = case cfg.lastfmApiKey of
<> "&format=json&api_key="
<> k
Log.info $ "Searching Last.fm for: " <> artist <> " - " <> release
- let headers = { "User-Agent": "corpus/1.0 (+https://github.com/mtmn/corpus)" }
+ let headers = { "User-Agent": "corpus/1.0 (+https://sr.ht/~mtmn/corpus)" }
result <- try $ fetch searchUrl { method: GET, headers }
case result of
Right fr | fr.status == 200 -> do
@@ -122,7 +122,7 @@ fetchDiscogsCoverUrl cfg artist release = case cfg.discogsToken of
<> (fromMaybe "" $ encodeURIComponent queryStr)
<> "&type=release&per_page=1"
Log.info $ "Searching Discogs for: " <> queryStr
- result <- try $ fetch searchUrl { method: GET, headers: { "User-Agent": "corpus/1.0 (+https://github.com/mtmn/corpus)", "Authorization": "Discogs token=" <> t } }
+ result <- try $ fetch searchUrl { method: GET, headers: { "User-Agent": "corpus/1.0 (+https://sr.ht/~mtmn/corpus)", "Authorization": "Discogs token=" <> t } }
case result of
Right fr | fr.status == 200 -> do
json <- fromJson fr.json
@@ -215,7 +215,7 @@ serveCover serveNotFound cfg slug url res = do
setHeader "Cache-Control" "public, max-age=3600" (toOutgoingMessage response)
end (toWriteable (toOutgoingMessage response))
when cfg.coverCacheEnabled $ void $ forkAff do
- let headers = { "User-Agent": "corpus/1.0 (+https://github.com/mtmn/corpus)" }
+ let headers = { "User-Agent": "corpus/1.0 (+https://sr.ht/~mtmn/corpus)" }
fetchResult <- try $ fetch urlStr { method: GET, headers }
case fetchResult of
Right fr | fr.status == 200 -> do
diff --git a/src/Metadata.purs b/src/Metadata.purs
@@ -43,7 +43,7 @@ type GenreSource =
fetchMusicBrainzRelease :: String -> Aff (Maybe MbData)
fetchMusicBrainzRelease mbid = do
let url = "https://musicbrainz.org/ws/2/release/" <> mbid <> "?inc=genres+labels+release-groups&fmt=json"
- result <- try $ fetch url { method: GET, headers: { "User-Agent": "corpus/1.0 +https://github.com/mtmn/corpus" } }
+ result <- try $ fetch url { method: GET, headers: { "User-Agent": "corpus/1.0 +https://sr.ht/~mtmn/corpus" } }
case result of
Left err -> do
Log.error $ "MusicBrainz fetch error for " <> mbid <> ": " <> Exception.message err
@@ -122,7 +122,7 @@ fetchDiscogsGenre (Just t) artist release = do
let queryStr = artist <> " " <> release
let searchUrl = "https://api.discogs.com/database/search?q=" <> (fromMaybe "" $ encodeURIComponent queryStr) <> "&type=release&per_page=1"
Log.info $ "Fetching Discogs genre for: " <> queryStr
- result <- try $ fetch searchUrl { method: GET, headers: { "User-Agent": "corpus/1.0 +https://github.com/mtmn/corpus", "Authorization": "Discogs token=" <> t } }
+ result <- try $ fetch searchUrl { method: GET, headers: { "User-Agent": "corpus/1.0 +https://sr.ht/~mtmn/corpus", "Authorization": "Discogs token=" <> t } }
case result of
Right fetchRes | fetchRes.status == 200 -> do
jsonResult <- try $ fromJson fetchRes.json
diff --git a/src/Sync.purs b/src/Sync.purs
@@ -88,7 +88,7 @@ fetchLastfmPage apiKey lfmUser page mTo = withRetry "Last.fm fetch" do
<> show page
<> toParam
url = baseUrl <> "&api_key=" <> apiKey
- let headers = { "User-Agent": "corpus/1.0 (+https://github.com/mtmn/corpus)" }
+ let headers = { "User-Agent": "corpus/1.0 (+https://sr.ht/~mtmn/corpus)" }
fr <- fetch url { method: GET, headers }
if fr.status == 200 then do
json <- fromJson fr.json
diff --git a/src/View.elm b/src/View.elm
@@ -684,7 +684,7 @@ renderAboutView currentSlug allUsers =
[ h2 [] [ text "links" ]
, p [ class "about-meta" ]
[ div [] [ extLink "https://instagram.com/counterpoint303" "counterpoint" ]
- , div [] [ extLink "https://github.com/mtmn/corpus" "github repo" ]
+ , div [] [ extLink "https://sr.ht/~mtmn/corpus" "sourcehut" ]
, div [] [ extLink "https://mtmn.name" "mtmn.name" ]
]
]