Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Chronology for shows #32

Open
deBasMan21 opened this issue Apr 9, 2023 · 3 comments
Open

Suggestion: Chronology for shows #32

deBasMan21 opened this issue Apr 9, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@deBasMan21
Copy link

Currently the movies have a chronology property with a number to order them chronologically. I would also like this property on the tv shows so all the projects can be ordered by that one property. I would love to hear if this is possible in some way.

@deBasMan21 deBasMan21 added the enhancement New feature or request label Apr 9, 2023
@AugustoMarcelo
Copy link
Owner

Hi, @deBasMan21. It's possible. I thought about this long ago, but I'm not 100% sure how to do it. I had plans to make one endpoint where all productions (movies and tv shows) are returned. However, each model is located in a different table. So I need to implement a strategy to add a chronology number that would be easy to change since each future production can be located in different places on the timeline.

@deBasMan21
Copy link
Author

@AugustoMarcelo Do you use any CMS or do you add the data directly into the db? If you use a CMS this would maybe be a good place to add some logic to make a GUI to drag and drop items and get the according index to save it in the db.

If thats not the case you could create a simple sql script that updates all the indices of the projects with a higher index than the new project with +1. Since there aren't a lot of projects being added this isn't really a big performance problem. It could be something like:

UPDATE projects 
SET chronology = chronology + 1 
WHERE chronology >= <<newProjectIndex here>>

Let me know if i can help you in any way :)

@AugustoMarcelo
Copy link
Owner

@deBasMan21 Today I just update the data directly in the DB. I understood your solution, but it's not possible to be done today because movies and tv shows are stored in different tables. I can just add a new field to the tv show model and create a chronology between them (tv shows). But if I want to do a global endpoint to return both sorted chronologically, the tv shows will not be placed correctly.
I think the solution may be to use a float number in the tv shows. So if it's placed between the movie 1 and 2 (chronologically speaking) it could be stored with 1.1 or something like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants