Commit Graph

4083 Commits

Author SHA1 Message Date
Ehsan Mohandesi
9063f9d732 Give the public data import job its own HttpClient
StartImportFromPublicDataRepo captured the injected, request-scoped HttpClient
inside the queued work item. The request completes long before the background
job runs, so the client was already disposed and the import died immediately
with ObjectDisposedException. Let the job own a client for its lifetime.
2026-09-13 22:16:28 -05:00
Ehsan Mohandesi
e7fbc6559d Fix 500 on failed login by encoding the redirect parameters
After a rejected login the site redirects back to /login carrying the API's
error message in the query string. That message is Persian, and HTTP header
values must be ASCII, so Kestrel threw InvalidOperationException and the user
got an error page instead of the login form with the reason for the failure.
Encode both the path and the message.

Not noticed before because IIS Express tolerates the non-ASCII Location header;
it surfaces as soon as the site is run on Kestrel.
2026-09-13 22:16:28 -05:00
Ehsan Mohandesi
cb7b1b03a3 Replace Spotify search with a validated music link box
The Spotify Web API integration stopped working, leaving /spotify unable to
suggest songs at all. Replace the artist/album/track search flow with a single
box where the user pastes a link to the track on a music service.

Links are checked against a hardcoded allow-list of legal streaming and store
domains so links to ripped audio cannot be submitted. The check lives in the
service layer, not just the page: any authenticated user can POST to
/api/ganjoor/song directly and bypass the UI. Hosts are matched against the
full host or a dot-prefixed suffix, so look-alikes such as
open.spotify.com.evil.com are rejected; https is required, and userinfo and
non-default ports are refused. Accepted URLs are canonicalised - https,
lowercased host, tracking parameters stripped - so the same track always yields
the same stored URL and duplicate detection actually works.

Links are stored under one new type, PoemMusicTrackType.MusicUrl, with the
platform derived from the host at render time. That needs no migration or
backfill, and supporting another service later needs no new enum value. The
duplicate check no longer keys on TrackType, which closes a gap where the same
URL could be resubmitted as a different type. Several links per poem remain
allowed; only an identical URL for the same poem is refused.

The Spotify search page and its OAuth plumbing are kept and simply redirect to
/musiclink while the existing SpotifyWorking flag is false, so the old flow can
be restored if that API ever works again.

Track URLs are no longer written through Html.Raw into href attributes. They
previously came from the Spotify API; now that they are user supplied, encoding
them prevents stored XSS.

Also fixes two latent bugs in SuggestSong that this flow would have hit: a null
dereference when TrackUrl is empty, and a singer lookup that matched any singer
with an empty Url.
2026-09-13 22:16:18 -05:00
Hamid Reza Mohammadi
7f76c5c9c1 caching fixes 2026-09-13 14:56:55 +03:30
Hamid Reza Mohammadi
0811bfd868 moderation new option 2026-09-13 13:39:48 +03:30
Hamid Reza Mohammadi
4920e85e45 include couplet sumaries in public data export 2026-09-12 16:06:54 +03:30
Hamid Reza Mohammadi
de3dbeefaa caching fix 2026-09-12 15:35:27 +03:30
Hamid Reza Mohammadi
da0648606e caching improvements 2026-09-12 15:05:43 +03:30
Hamid Reza Mohammadi
91bfd79465 tajik recitation fix 2026-09-12 13:28:23 +03:30
Hamid Reza Mohammadi
652c9ac43e tajik recitation player improvments 2026-09-12 13:24:45 +03:30
Hamid Reza Mohammadi
fb87847d65 recitation icons fix 2026-09-12 12:23:36 +03:30
Hamid Reza Mohammadi
157565496d lock on recitation 2026-09-12 12:15:01 +03:30
Hamid Reza Mohammadi
566ff6d002 go to current position of recitation 2026-09-12 09:42:42 +03:30
Hamid Reza Mohammadi
5ebf07d485 bottpm audio player 2026-09-12 07:38:52 +03:30
Hamid Reza Mohammadi
64fdb6318c semantic search 2026-09-11 16:45:47 +03:30
Hamid Reza Mohammadi
7f3bcebad7 semantic search improvements 2026-09-11 14:17:48 +03:30
Hamid Reza Mohammadi
3814f6234d semantic search improvemenst 2026-09-11 14:10:56 +03:30
Hamid Reza Mohammadi
e679ee8caa semantic search dev guide 2026-09-11 08:33:31 +03:30
Hamid Reza Mohammadi
60b1625bbb semantic search dev guide 2026-09-11 08:30:48 +03:30
Hamid Reza Mohammadi
4369252060 recitation currrent audio sync fix 2026-09-11 07:47:15 +03:30
Hamid Reza Mohammadi
47445877d2 semantic search 2026-09-10 19:38:38 +03:30
Hamid Reza Mohammadi
f2ce952bb8 api xml update 2026-09-10 14:50:55 +03:30
Hamid Reza Mohammadi
150ec860ed semantic search 2026-09-10 14:43:03 +03:30
Hamid Reza Mohammadi
1303431972 semantic search 2026-09-10 14:42:11 +03:30
Hamid Reza Mohammadi
b0d21bbb09 semantic search control 2026-09-10 14:19:06 +03:30
Hamid Reza Mohammadi
3d8b0867d8 semantic search 2026-09-10 14:12:26 +03:30
Hamid Reza Mohammadi
851ea607a2 semantic search 2026-09-10 13:47:27 +03:30
Hamid Reza Mohammadi
e63c8c5e9d semantic search 2026-09-10 13:03:20 +03:30
Hamid Reza Mohammadi
5c70e88b09 semantic search fix 2026-09-10 09:02:20 +03:30
Hamid Reza Mohammadi
3eb4a6025a BackgroundTaskQueue:MaxConcurrency 2026-09-09 14:47:35 +03:30
Hamid Reza Mohammadi
65737c73d8 fix for semantic search 2026-09-09 14:07:00 +03:30
Hamid Reza Mohammadi
e42cc5d8eb semantic search 2026-09-09 13:17:21 +03:30
Hamid Reza Mohammadi
0762f19fb4 semantic search 2026-09-09 11:07:09 +03:30
Hamid Reza Mohammadi
6255d4d8ca db migration - signup fix 2026-09-08 08:39:21 +03:30
Hamid Reza Mohammadi
63832b57c9 editor improvements 2026-09-06 07:37:14 +03:30
Hamid Reza Mohammadi
b0ca62a579 editor improvements 2026-09-05 16:28:51 +03:30
Hamid Reza Mohammadi
96a36f2dc2 editor improvements 2026-09-05 16:08:00 +03:30
Hamid Reza Mohammadi
1ac05f2f18 improving editor 2026-09-05 15:30:50 +03:30
Hamid Reza Mohammadi
842d47abb9 image caching fix 2026-09-04 19:40:42 +03:30
Hamid Reza Mohammadi
4be5ec14f3 caching mechanism fixes 2026-09-04 19:16:04 +03:30
Hamid Reza Mohammadi
b8c521a01d nuget updates 2026-09-04 15:58:13 +03:30
Hamid Reza Mohammadi
32041f4e65 Search should include title texts wherever title carries important context
#506
2026-09-04 15:55:07 +03:30
Hamid Reza Mohammadi
ef5b61bf03 warning fix 2026-09-04 15:53:19 +03:30
Hamid Reza Mohammadi
f379fcdbae updating nugets 2026-09-04 15:18:37 +03:30
Hamid Reza Mohammadi
56f74d4760 caching fixes 2026-09-04 14:29:11 +03:30
Hamid Reza Mohammadi
b7992bc919 image caching fix 2026-09-04 13:56:29 +03:30
Hamid Reza Mohammadi
cdd6107319 changing css/js version numbers 2026-09-02 14:22:55 +03:30
Hamid Reza Mohammadi
fca38516d3 improving partials 2026-09-02 14:18:37 +03:30
Hamid Reza Mohammadi
c0803000f3 double click to open beyt partial control 2026-09-02 13:59:03 +03:30
Hamid Reza Mohammadi
ce4ff283d5 tinymce initialization bug fix 2026-09-02 13:34:30 +03:30