belaudiobooks / website

Catalog of belarusian audiobooks
GNU General Public License v3.0
33 stars 6 forks source link

Add publishers #59

Closed nbeloglazov closed 1 year ago

nbeloglazov commented 2 years ago

Many books, especially recently recorded, should specify publisher. There can be multiple publishers for the same book, for example https://audiobooks.by/books/aposhniaia-kniga-pana-a has 2 publishers: Янушкевіч і Вясна.

Publisher should probably be set on Narration level, not Book leve. The reason is that same book can be recorded by different publishers. It becomes potentially tricky in cases like: paper book published by A, then it was recorded by two different publishers B and C. Then book has two narrations. The first narration will have publishers A and B. The second - A and C.

nbeloglazov commented 2 years ago

Fields for publisher: name, website, description.

frombrest commented 1 year ago

Hi @nbeloglazov could you look at this scratch of changes https://github.com/belaudiobooks/website/commit/6cd87a565deca795f39f0c5f686cbd85b850af61 And share your thoughts... Does this look like what you mean?

nbeloglazov commented 1 year ago

Roughly yes! Though I wasn't thinking about having a Publication sitting between Publisher and Narration. What's the benefit of having it? So that we can attach publisher-specific information to narration? I'm not sure we need that level of abstraction at the moment. You created PublisherRole enum. Overall it makes sense if we were to design full publishing model (including print and e-books) but we don't have plans for that. So I would keep it simpler and more limited for now.

frombrest commented 1 year ago

So I would keep it simpler and more limited for now.

ok 👍

What's the benefit of having Publication

Just to reflect the role which plays Publisher in this particular narration.

So we just keep Many-to-Many relation between Narration and Publisher right? And how we going to reflect Publishers in book details template for the cases with singe and multiple narrations and cases with singe and multiple publishers like in example from issue description?

nbeloglazov commented 1 year ago

So we just keep Many-to-Many relation between Narration and Publisher right?

Yes.

As for rendering:

We can render Publishers same as we render people, using same layout. We should also introduce logo field for publishers.

In the book details template - same as we render narrators today: with single narration they are rendered at the top, with multiple - at narration level. Example: image

frombrest commented 1 year ago

We can render Publishers same as we render people, using same layout. We should also introduce logo field for publishers.

And slug field too. Right?

nbeloglazov commented 1 year ago

Ah, yes, slug as well. Forgot about it.

nbeloglazov commented 1 year ago

Thanks @frombrest! Deployed and added our site as publisher for books we produced: https://audiobooks.by/publisher/audiobooksby

Few things left (beside adding more publishers):

  1. Implement searching by publisher. Similar how we can search by person.
  2. Add publishers to generated data.json file.
nbeloglazov commented 1 year ago

Deployed latest improvements to prod! Wrt user-visible features we are done. The only thing left here is adding tests. @frombrest will you look into it or I can do it. The tests should cover:

  1. Check that the publisher is rendered on the book info page.
  2. Check that publisher page is working correctly.
  3. Test search by publisher.
  4. Verify that sitemap.txt contains publishers.