Commit graph

217 commits

Author SHA1 Message Date
Mike Colagrosso
0490ba2951 Remove Content-Disposition config for downloads
It's necessary to remove these headers now that the file download
redirects to `www/ebooks/download.php`. If not, the browser raises an
error about the header set twice.
2025-04-25 14:31:44 -05:00
Mike Colagrosso
03ed3c2257 Add Ebook::DownloadUrl for web and feed downloads
This commit adds a rewrite rule for ebook downloads of the form:

```
/ebooks/some-author/some-book/downloads/some-filename.epub
```

to `www/ebooks/download.php`. That file handles the logic of whether to
show a thank you page before beginning the download.

Download URLs in RSS, Atom, and OPDS feeds follow the same pattern, but
they have a query string parameter `?source=feed` to always skip the
thank you page.
2025-04-25 14:31:44 -05:00
Alex Cabal
b70f500847 Decrease minimum token count to 2 in InnoDB fulltext search 2025-04-02 15:46:36 -05:00
Alex Cabal
849276736e Move donwload rewrite rule after legacy ebook URL rewrites 2025-03-30 14:35:03 -05:00
Alex Cabal
de96695ac7 Add rewrite for The Giant Raft by Jules Verne 2025-03-26 14:50:12 -05:00
Alex Cabal
8a3a05a264 Ban ChatGPT user agents 2025-03-24 13:59:13 -05:00
Mike Colagrosso
af956b2714
Replace EbookUrl with EbookId in Artworks (#482)
* Replace `EbookUrl` with `EbookId` in `Artworks`

* Add a `FullUrl` member to `Ebook`

Add documentation about when to use it versus Url.

The full URL is also being used as an ID in RSS feeds, so use `FullUrl` there.

* Store an `EbookId` in `Artworks`
2025-03-10 14:33:20 -05:00
Alex Cabal
34fd71e55a Tweak wording on delete artist page and add some more breadcrumbs 2025-03-07 10:37:56 -06:00
Alex Cabal
1136cfb2af Add artists rewrites to live site Apache config 2025-03-07 09:57:07 -06:00
Mike Colagrosso
a91509726c
Add admin tool to handle duplicate artist names (#480) 2025-03-06 14:28:26 -06:00
Alex Cabal
124e8343fc Completely type hint template functions and switch to named arguments 2025-03-04 20:32:20 -06:00
Alex Cabal
a019d5e87c Enable some additional PHPStan rules and fix some type issues 2025-03-01 13:39:57 -06:00
Alex Cabal
11e5770413 Update Composer dependencies, clean up PHPStan config file, and remove Constants.php from Composer in favor of PHPStan configuration 2025-02-28 10:52:16 -06:00
Alex Cabal
99b5fd66f2 More type fixes 2025-02-26 15:17:08 -06:00
Alex Cabal
94d674ef96 Tweak test secrets file 2025-02-26 14:28:01 -06:00
Mike Colagrosso
1eeab11353 Add default values for config vars 2025-02-26 14:17:11 -06:00
Alex Cabal
9d1b66d19e Update PHPStan and Safe PHP, and review codebase for further type correctness 2025-02-25 22:41:18 -06:00
Alex Cabal
e2e14a3551 Remove DbConnection class in favor of fully-static and typed Db class 2025-02-25 16:47:25 -06:00
Mike Colagrosso
a3ce3f1ec1 Make IndexableText optional
Placeholders do not have FullTitle, AlternateTitle, Tags, LocSubjects,
or TocEntries.
2025-02-13 13:48:39 -06:00
Mike Colagrosso
61bbf8f071 Add idxSearchCombined to match multiple fields
The data in these fields are separate:

* `IndexableText`
* `Title`
* `IndexableAuthors`
* `IndexableCollections`

There are also on indices on each of these fields so that they can have
separate weight in the relevance scoring.
2025-02-13 13:48:39 -06:00
Mike Colagrosso
1a71913794 Add a Relevance sort order and improve search
Here's what's in `IndexableText` right now:

1. Title
2. Collections
3. Authors
4. Tags
5. LocSubjects
6. TocEntries

Here is the proposed new ranking:

```
10 * Title +
8 * Authors +
3 * Collections +
IndexableText
```

New indices for existing DBs:

```
ALTER TABLE `Ebooks` ADD COLUMN `IndexableAuthors` text NOT NULL;
ALTER TABLE `Ebooks` ADD COLUMN `IndexableCollections` text NULL;
ALTER TABLE `Ebooks` ADD FULLTEXT `indexSearchTitle` (`Title`);
ALTER TABLE `Ebooks` ADD FULLTEXT `idxSearchAuthors` (`IndexableAuthors`);
ALTER TABLE `Ebooks` ADD FULLTEXT `idxSearchCollections` (`IndexableCollections`);
```
2025-02-13 13:48:39 -06:00
Alex Cabal
932ce2b2b1 Add ebook redirect 2025-02-03 15:42:06 -06:00
Alex Cabal
6378d687d8 Add 'awaiting review' and 'reviewed' project statuses that update from GitHub; allow project owners to update their project statuses 2025-01-27 15:52:21 -06:00
Alex Cabal
b48f3a5798 Improve honeypot link 2025-01-27 10:49:44 -06:00
Alex Cabal
c1e8e83cfb Block some leechers in Apache config 2025-01-25 14:13:49 -06:00
Alex Cabal
37aaa97b66 Brower compatibility for ::before alt text 2025-01-19 13:28:45 -06:00
Alex Cabal
8f2df6ac12 Fix broken Apache config 2025-01-18 17:32:38 -06:00
Alex Cabal
bdeebc8291 Add endpoint to get collections for an ebook or placeholder 2025-01-15 14:32:50 -06:00
Alex Cabal
bc16b1fff8 Add endpoint to get reviewer for an in-progress project 2025-01-07 21:42:51 -06:00
Alex Cabal
1cb4cbfe24 Redirect ebook searches for only one tag to the /subjects/<TAG endpoint 2025-01-05 13:52:09 -06:00
Alex Cabal
99508cc490 Correctly return 404 instead of 403 for ebooks with spaces in the URL 2025-01-05 13:27:35 -06:00
Mike Colagrosso
dad5df0059 Add index on EbookId
There are several queries that join the `Projects` and `Ebooks` tables.
An index speeds up those joins.
2025-01-02 09:57:45 -06:00
Mike Colagrosso
5c8315e6ff Add new indices for deleting unused records 2024-12-31 22:31:00 -06:00
Alex Cabal
616b9677a9 Fix donation progress bar 2024-12-30 22:04:09 -06:00
Alex Cabal
8e8cbb0c5e Move delete form and more multi select fixes 2024-12-19 14:40:38 -06:00
Alex Cabal
93b8008c7e Add missing MultiTableSelect code 2024-12-19 14:25:48 -06:00
Alex Cabal
4596aeb007 Allow projects to auto-assign managers and reviewers 2024-12-18 20:57:21 -06:00
Alex Cabal
b2191d1219 Allow editing of projects 2024-12-18 14:20:28 -06:00
Mike Colagrosso
f449c024ea Add /edit endpoint to update placeholders 2024-12-18 12:58:18 -06:00
Alex Cabal
7a3c7ad503 Allow VCS URLs to be null in projects 2024-12-16 21:48:01 -06:00
Alex Cabal
d902074285 Add new project form, and allow projects to be created when attempting to create a placeholder that already exists. 2024-12-16 21:27:45 -06:00
Alex Cabal
8e6b05a150 Fix typos 2024-12-16 15:49:18 -06:00
Alex Cabal
051e286a6d Continue fleshing out project management system 2024-12-16 15:01:22 -06:00
Alex Cabal
5782d6ca7d Further refine projects system 2024-12-15 23:39:23 -06:00
Alex Cabal
2449de6f6c Also check discussion threads for freshness when marking projects as stalled 2024-12-15 21:59:01 -06:00
Alex Cabal
9b9d93bc52 Automatically update in progress projects to stalled 2024-12-14 23:54:11 -06:00
Alex Cabal
c7a4e34e31 Add projects index page, and more detail on placeholder pages 2024-12-14 21:12:00 -06:00
Alex Cabal
adfe07aad9 Add beginning of a project management system to placeholders 2024-12-14 19:13:03 -06:00
Alex Cabal
e56de4b19d Switch from EbookPlaceholder.Status to EbookPlaceholder.IsInProgress, and some type tweaks 2024-12-14 13:39:28 -06:00
Alex Cabal
1a742baa51 Add CanEditEbooks benefit and clean up some PHPStan errors 2024-12-14 11:50:16 -06:00