WeebWare / Ranobe-Honyaku

A novel translation platform.
MIT License
8 stars 2 forks source link

(Model) Chapter vs. Parts (Discussion) #11

Closed cloudiirain closed 7 years ago

cloudiirain commented 8 years ago

Recently, @GetRektByMe and me have been discussing models for the database. Recchan's suggestion can be found here, whereas mine can be found here.

One of the major points where we differ is whether there should be a class for Parts of a chapter.

What are Parts?

Chapter 1

Chapter 2

Chapter 3 <-- only one part, so link at this level Chapter 4

  • I suggested having any Part-related logic as fields of Chapter. For instance, we could have an is_part field with a boolean that marks this "chapter" as only a part, which would signal it for different behavior on EPUB generation. Order of the parts could be inferred from chapter order. Example:

Chapter 1 Part 1 Chapter 1 Part 2 Chapter 1 Part 3 Chapter 2 Part 1 Chapter 2 Part 2 Chapter 3 Chapter 4

Note that you could also achieve this layout with Recchan's model by rendering all the parts merged together in one view. (Just saying it's not hard to do, and the layout on the UI shouldn't determine how the model design takes place

Why a separate class for Parts?

I'll elaborate on the third point more.

Generally speaking, in relational databases, you need to create the independent object before the dependent object in one-to-many relationships. For instance, Series must be created before you start creating Chapters for the series.

If we add another relationship at this point, UX is more complicated because a translator must first create the Chapter before creating the Part. This is generally done in either two POST requests (meaning a page refresh between the two), or two AJAX requests (at least to check whether a new chapter exists/fetching a list of chapters on the select form)... or 1 AJAX request (creating a chapter and part at the same time) if you're confident the chapter doesn't exist.

I mean, as a translator uploading something, I don't really care whether the model on our app takes things as parts or as a full chapter. I just want to upload something that I translated. I'm looking to select the series that I'm translating, type the name of my chapter (if it's a part, just specify it in the title), paste and upload!

With parts as an additional class, I need to select the series I'm translating, select the chapter this part belongs to (or none at all), type the name of my part (which in most cases is just a chapter), paste and upload! There's one more user interaction (which doesn't make sense to a translator who doesn't use parts and always uploads full chapters).

cloudiirain commented 8 years ago

In relation to this issue (retranslations of the same chapter), I think it's important to point out that translators do make arbitrary breaks/divisions and call them parts. We also have no way of policing/enforcing translators to use to same convention for defining what constitutes or does not constitute a part.

Therefore a part divisions defined by Translator Joe may not be the same part divisions defined by Translator Bob in a retranslation situation.

danieltanfh95 commented 8 years ago

Can I know how does epub generators parse the page for parts? like how do it know that this is a part.

byronvanstien commented 7 years ago

Parts on chapters were both added in 434c0d0 the displaying of this will be handled in the front end, which will check if the highest position is 0, and will omit the Part 1 if it is