Commit graph

102 commits

Author SHA1 Message Date
Mike Colagrosso
ec26e7f9af Remove Library::RebuildCache 2024-11-04 13:16:56 -06:00
Mike Colagrosso
f4a19a2d12 Replace GetEbooksFromFilesystem with a DB implementation 2024-11-04 13:16:56 -06:00
Mike Colagrosso
364a2ca78f Rename GetAllArtists to GetArtists 2024-11-04 13:16:56 -06:00
Mike Colagrosso
6c8e819316 Implement OpenSearch feed search with FilterEbooks 2024-11-04 13:16:56 -06:00
Mike Colagrosso
807e8410b4 Use array shapes in the PHPDoc
This makes the extra documentation unnecessary
2024-11-04 13:16:56 -06:00
Mike Colagrosso
989dcab9f0 Implement FilterEbooks via DB 2024-11-04 13:16:56 -06:00
Mike Colagrosso
be6873d21d Remove distinct from query in GetEbookCollections
The point of the commits in #374, e.g., the new `CollectionEbooks` table, was so that `distinct` wasn't needed.
2024-11-04 13:16:56 -06:00
Mike Colagrosso
50aa81cb29 Create a helper function for SQL set membership 2024-11-04 13:16:56 -06:00
Mike Colagrosso
44dc65005d Query Contributors table for GetEbooksByAuthor() 2024-11-04 13:16:56 -06:00
Mike Colagrosso
2d5e66f2f2 Get carousel books from the DB 2024-11-04 13:16:56 -06:00
Mike Colagrosso
402dae95ff Add a Type enum to Tags for artwork/ebook 2024-11-04 13:16:56 -06:00
Mike Colagrosso
ee29c526f8 Add a CollectionMembership class 2024-11-04 13:16:56 -06:00
Mike Colagrosso
43416e76db Get list of tags from DB 2024-11-04 13:16:56 -06:00
Mike Colagrosso
b3a173aa91 Get ebooks in a collection from DB 2024-11-04 13:16:56 -06:00
Mike Colagrosso
da68637ba0 Get list of collections from DB 2024-11-04 13:16:56 -06:00
Mike Colagrosso
4653b15288 Get ebook from DB for artworks 2024-11-04 13:16:56 -06:00
Mike Colagrosso
2098b265a8 Rename the constructor Ebook::__construct() to static Ebook::FromFilesystem()
Also added `GetFoo()` methods for all the derived properties like `GetUrl()`, `GetHasDownloads()`, etc. Removed that logic from the constructor so that it's reusable in `Ebook::FromFilesystem()` and `Ebook::GetByIdentifier()`
2024-11-04 13:16:56 -06:00
Mike Colagrosso
f605a4df60 Rename Created and Updated in PHP code to EbookCreated and EbookUpdated to match the schema 2024-11-04 13:16:56 -06:00
Mike Colagrosso
572fd90fed Replace Library::GetEbookByIdentifier with Ebook::GetByIdentifier
The new method throws an exception instead of returning null.
2024-11-04 13:16:56 -06:00
Mike Colagrosso
63d411a2e6 Initial code changes to insert/update Ebook records 2024-11-04 13:16:56 -06:00
Alex Cabal
eec79712fc Use a NOW constant instead of new DateTimeImmutable objects, and tweak how some donation drive dates work 2024-10-15 22:21:12 -05:00
Mike Colagrosso
ad9bdde32d Use array shapes in PHPDoc for FilterArtwork 2024-07-06 15:02:47 -05:00
Alex Cabal
4b796c0155 Add more type hints 2024-05-16 14:05:00 -05:00
Alex Cabal
a9eab552ab Flesh out some PHPDocs, and consistently name enums 2024-05-14 15:40:56 -05:00
Alex Cabal
52e177b886 Add new methods to DbConnection class 2024-05-13 15:13:02 -05:00
Alex Cabal
acb6b2949f Use static class names instead of strings when getting objects from the DB 2024-05-13 14:49:28 -05:00
Alex Cabal
70ae877dd8 Bump PHPStan check level to max and add final round of type hints 2024-05-13 10:48:05 -05:00
Alex Cabal
703e1a7a03 Continue improving type hints 2024-05-10 23:38:57 -05:00
Alex Cabal
c4c8e7353f Enable strict exception type hint checking in PHPStan and add exception type hints 2024-05-10 20:47:36 -05:00
Alex Cabal
e55fecaaa2 Switch from DateTime to DateTimeImmutable across codebase 2024-04-13 14:05:14 -05:00
Mike Colagrosso
d95d9b3349 Refactor Library::FilterEbooks and Template::SearchForm to accept EbookSort 2024-01-30 11:10:05 -06:00
Mike Colagrosso
980ed8cea9 Convert ebook SORT_ constants to an enum 2024-01-30 11:10:05 -06:00
Mike Colagrosso
94dce1009a Refactor Library::FilterArtwork and artworks/index.php to accept ArtworkSort 2024-01-30 11:10:05 -06:00
Mike Colagrosso
004a4a27c3 Convert SORT_COVER_ constants to an enum 2024-01-30 11:10:05 -06:00
Alex Cabal
3606a5c425 Restore missing 'order by' clause to artwork list 2024-01-29 18:32:15 -06:00
Alex Cabal
a9dcdcde94 Limit artwork results at the DB level 2024-01-28 14:04:29 -06:00
Alex Cabal
1a14a775d4 Add clarifying comment 2024-01-23 23:54:59 -06:00
Alex Cabal
cbf87487eb Use ebook URL and not filesystem slug to identify ebooks in artworks 2024-01-23 23:11:30 -06:00
Mike Colagrosso
91ac96d784 Add status and user filtering to GetArtworksByArtist 2024-01-23 21:34:27 -06:00
Mike Colagrosso
53dc36d25a Fix searching for words adjacent to an underscore in EbookWwwFilesystemPath 2024-01-23 13:54:41 -06:00
Alex Cabal
e3ea224256 Tweak style 2024-01-23 13:51:34 -06:00
Mike Colagrosso
93adef171f s/GetArtworkByArtist/GetArtworksByArtist/ 2024-01-23 13:46:12 -06:00
Mike Colagrosso
cad2f5f730 List artwork by artist via /artworks/<artist-name> 2024-01-23 13:46:12 -06:00
Alex Cabal
478eb200c8 Add rsquo to artwork filter query parsing 2024-01-22 13:33:27 -06:00
Mike Colagrosso
8a8692619c Keep words with apostrophes intact when searching
The code will convert a search for:

`Whistler's Mother`

into:

`\b(whistler's|mother)\b`

Before this fix, it was:

`\b(whistler|s|mother)\b`
2024-01-22 09:57:33 -06:00
Mike Colagrosso
d8360b28ca
Replace PHP filtering with pure SQL (#323)
* Replace PHP filtering with pure SQL
2024-01-21 14:08:46 -06:00
Mike Colagrosso
67fcdedd08
Library::FilterArtwork(): Move sort logic to SQL, condense status condition (#321)
Move artwork sort logic to SQL
2024-01-19 23:24:22 -06:00
Alex Cabal
2b5f4f55a2 Style tweaks to artworks DB 2024-01-18 10:50:14 -06:00
Alex Cabal
5ef6d3aef8 Artwork db code tweaks, also remove 'in use' as a status 2024-01-17 16:04:11 -06:00
Mike Colagrosso
4b2e02950f Use ArtworkStatus enums when querying, not strings 2024-01-17 12:12:25 -06:00