Commit graph

5305 commits

Author SHA1 Message Date
Mouse Reeve 2cbc8db5f7 Migrations need to be in two files to work
Good news: they run now
2022-07-03 18:45:49 -07:00
Mouse Reeve f8a1b37eda Fixes mistyped field name 2022-07-03 12:48:01 -07:00
Mouse Reeve e1fba5ccfe Adds readthrough status to readthrough object
Each readthrough should represent a unique instance of reading a book,
and so it should have a single status that represents that status of
that readthrough. This will be used to place the book on the appropriate
"shelves", and should allow for there to be a single active readthrough
if a book is in progress. That maeks the `is_active` field unnecessary.

Since the status of the readthrough is unambiguous, defining "finished
date" and "stopped date" separately is no longer necessary.

I've sketched out some database constraints but haven't implemented them
yet, because the conflicts might get gnarly and let's take this one step
at a time.

The migration logic is complex, so this is an untested draft and I'll
write unit tests for it in a subsequent commit.
2022-07-03 12:22:20 -07:00
Mouse Reeve 0b900dc1ac
Merge pull request #2166 from bookwyrm-social/email-config-warning
Add warning to dashboard if email sender looks misconfigured
2022-07-03 10:49:14 -07:00
Mouse Reeve 89165fd909 Creates helper function for creating charts 2022-07-03 08:28:24 -07:00
Mouse Reeve e16506c1df Fixes logic error in checking relationships
I had the logic backwards for pending relationships.
2022-07-02 21:25:07 -07:00
Mouse Reeve 516c4a9790 Add warning to dashboard if email sender looks misconfigured
This can be a really obscure error, hopefully this warning will catch
potential issues.
2022-07-02 21:11:23 -07:00
Mouse Reeve 4ccbfb6b31
Merge pull request #2057 from bookwyrm-social/list-privacy
Re-consider list privacy on edit
2022-07-02 20:07:00 -07:00
Mouse Reeve 6e70ceb094 More mocks 2022-07-02 19:43:59 -07:00
Mouse Reeve 46421f9672 Mocks for lists model 2022-07-02 13:48:15 -07:00
Mouse Reeve 495bf203b0 Mocks inbox and search tests 2022-07-02 13:45:53 -07:00
Mouse Reeve 3ad0a5d073 Use update_fields to limit remove_list_tasks
If we know what fields were updated, we can avoid running this task.
This also adds some mocks where they are needed for the list view.
2022-07-02 13:23:23 -07:00
Mouse Reeve 13605b7d6a
Merge pull request #2164 from bookwyrm-social/federated-servers-admin
Federated servers admin
2022-07-02 12:17:14 -07:00
Mouse Reeve aae02dff9a Merge branch 'main' into list-privacy 2022-07-02 12:16:39 -07:00
Mouse Reeve 94a6675dc4 Pylint fixes 2022-07-02 12:07:22 -07:00
Mouse Reeve 13e23a868d Adds instance name filter to federated instance list view
This lets you look for a specific server in your (probably very long)
instance list.
2022-07-02 11:12:15 -07:00
Mouse Reeve e0a67f5e18 Uses := syntax in user admin view
I learned this! It's cool.
2022-07-02 11:06:48 -07:00
Mouse Reeve cbb979242d
Revert "Use async requests for broadcasting" 2022-07-02 10:56:18 -07:00
Mouse Reeve f5d6a18ce0 Alphabetize list of software options in federated instances list 2022-07-02 10:49:57 -07:00
Mouse Reeve be76fe1494
Merge pull request #2143 from bookwyrm-social/async_broadcast
Use async requests for broadcasting
2022-07-02 10:23:02 -07:00
Mouse Reeve e7b0a84ded
Merge pull request #2142 from bookwyrm-social/load-data-duration
Split expand book data task into per-edition tasks
2022-06-30 11:47:23 -07:00
Mouse Reeve e3471fcc35
Merge pull request #2148 from hughrun/quotes
add page numbers to comment and quote statuses
2022-06-10 17:35:15 -07:00
Joel Bradshaw 7f5d47a36f Use values_list with flat, yay! 2022-06-07 23:15:34 -07:00
Mouse Reeve 3aa159bc89
Merge branch 'main' into preview-generation-memory 2022-06-05 18:39:59 -07:00
Mouse Reeve 8d082bc189
Merge branch 'main' into quotes 2022-06-05 15:42:01 -07:00
Mouse Reeve 08231f52ff
Merge pull request #2150 from cincodenada/fix-pylint
Fix pylint config for pylint 2.14.0
2022-06-05 15:41:32 -07:00
Joel Bradshaw 6d6ab9a531 Add .pylintrc with fixes for new pylint version 2022-06-05 14:38:03 -07:00
Joel Bradshaw b744ff7836 Run black 2022-06-05 13:40:01 -07:00
Joel Bradshaw 482005f304 Update preview image generation to only query ids
Previously we were querying the full book objects just to get a list of
id's, which is much slower and also takes a lot more memory, which can
cause the process to be killed on memory-limited machines with a large
number of books.

Instead, since we're just dispatching jobs here, we can just ask for the
id's, which is faster and much more practical memory-wise.

The map is a little annoying, I didn't see a way to directly get just a
list of the value of one field, so we have to get a list of
dictionairies with one key and then pull that key out. Whatevs.
2022-06-05 13:07:44 -07:00
Hugh Rundle 4de9989d8e add page numbers to comment and quote statuses
This adds the page number for quote and comment statuses where a page number is provided:

- all ActivityPub posts
- Explore cards for comments (quotes already have the page number)

This responds to #2136
2022-06-05 16:02:25 +10:00
Mouse Reeve 9d5e113b92
Merge pull request #2145 from bookwyrm-social/about-layout
Clip column in about page
2022-05-31 14:05:43 -07:00
Mouse Reeve c738eaa2c2 Use async requests for broadcasting
When an activity needs to be broadcast to the whole wide fediverse, the
number of requests can get enormous and the broadcast task ends up
taking ages to run. This change sends these requests out in one aiohttp
session, to improve performance.
2022-05-31 13:09:27 -07:00
Mouse Reeve d149e57494 Split expand book data task into per-edition tasks
Loading every edition in one task takes ages, and produces a large task
that clogs up the queue. This will create more, smaller tasks that will
finish more quickly.
2022-05-31 12:41:57 -07:00
Mouse Reeve 20f452ebf4 Clip column in about page
Text in the superlatives section can cause this column to expand outside
the container.
2022-05-31 12:23:59 -07:00
Mouse Reeve 374fdcf467 Use relative list order ranking in openlibrary search
Set OpenLibrary search condifidence based on the provided result order,
just using 1/(list index), so the first has rank 1, the second 0.5, the
third 0.33, et cetera.
2022-05-31 10:22:49 -07:00
Mouse Reeve 355e7039f0
Merge pull request #2139 from bookwyrm-social/search-refactor
Search refactor
2022-05-31 10:22:17 -07:00
Mouse Reeve c3b35760a2 Updates test mocks for remote search 2022-05-31 09:37:54 -07:00
Mouse Reeve 969db13ff2 Safely return None in remote search return_first 2022-05-31 08:49:23 -07:00
Mouse Reeve 05fd30cfcf Pylint fixes in connector tests 2022-05-31 08:37:07 -07:00
Mouse Reeve 5e99002aad Raise priority for external connectors in initdb
By default, OpenLibrary and Inventaire were prioritzed below other
BookWyrm nodes. In practice, people have gotten better search results
from these connectors, hence the change. With the search refactor, this
has much less impact, but it will show these search results higher in
the list.

If the results page shows all the connectors' results integrated, this
field should be removed entirely.
2022-05-31 08:25:02 -07:00
Mouse Reeve a053f20961 Re-implements return first option
Since we get all the results quickly now, this aggregates all the
results that came back and sorts them by confidence, and returns the
highest confidence result. The confidences aren't great on free text
search, but conceptually that's how it should work at least.

It may make sense to aggregate the search results in all contexts, but
I'll propose that in a separate PR.
2022-05-31 08:20:59 -07:00
Mouse Reeve 98ed03b6b4 Python formatting and test update 2022-05-30 17:00:34 -07:00
Mouse Reeve 83ee5a756f Filter intentaire results by confidence 2022-05-30 16:42:37 -07:00
Mouse Reeve af19d728d2 Removes outdated unit tests 2022-05-30 16:16:10 -07:00
Mouse Reeve 87fe984462 Combines search formatter and parser function
The parser was extracting the list of search results from the json
object returned by the search endpoint, and the formatter was converting
an individual json entry into a SearchResult object. This just merged
them into one function, because they are never used separately.
2022-05-30 12:52:31 -07:00
Mouse Reeve 525e2a591d More error handing
Adds logging and error handling for some of the numerous ways a request
could fail (the remote site is down, the url is blocked, etc).

I also have the results boxes open by default, which makes it more
legible imo.
2022-05-30 12:40:13 -07:00
Mouse Reeve 45f2199c71 Gather and wait on async requests
This sends out the request tasks all at once and then aggregates the
results, instead of just running them one after another asynchronously.
2022-05-30 12:05:22 -07:00
Mouse Reeve 5e81ec75fb Set request headers in async search get request
Gotta ask for json
2022-05-30 11:19:16 -07:00
Mouse Reeve 9a9cef7766 Verify url before async search
The database lookup doesn't work during the asyn process, so this change
loops through the connectors and grabs the formatted urls before sending
it to the async handler.
2022-05-30 11:16:05 -07:00
Mouse Reeve 0adda36da7 Remove search endpoints from Connector
Instead of having individual search functions that make individual
requests, the connectors will always be searched asynchronously
together. The process_seach_response combines the parse and format
functions, which could probably be merged into one over-rideable
function.

The current to-do on this is to remove Inventaire search results that
are below the confidence threshhold after search, which used to happen
in the `search` function.
2022-05-30 10:37:24 -07:00