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

Image refactoring in the database #161

Closed
oskarrough opened this issue Nov 28, 2017 · 5 comments · Fixed by #260
Closed

Image refactoring in the database #161

oskarrough opened this issue Nov 28, 2017 · 5 comments · Fixed by #260
Assignees

Comments

@oskarrough
Copy link
Member

We are loading way too many images from the database.

Background. We have two models: channel and image. A channel has many images although we never use anything but the latest image from a channel. The latest is aliased with channel.coverImage in the Ember model.

When you upload a new image to a channel, the old images are NOT deleted. We simply always refer to the newest one. This, combined with the fact that the relationship is marked as async, we end up loading and processing tons of images.

Idea for a solution:

  1. Run a script on the DB to remove all old images, also from the cloudinary. Or at least save them in a list so we can delete them at some point.
  2. Change hasMany to belongsTo
@4www
Copy link
Contributor

4www commented Oct 15, 2018

Maybe we should let this one open until the feature is really live?

  • update the player with new access to channel.image --> Refactor to new image format radio4000-player#124
  • discuss database migration issue (db-backups are unusable without migration scripts, because the model keys are being changed over time in the app and db, but not in the backups)

@4www 4www reopened this Oct 15, 2018
@oskarrough oskarrough self-assigned this Oct 16, 2018
@oskarrough
Copy link
Member Author

@4www
Copy link
Contributor

4www commented Jan 16, 2019

Before closing this, need to:

@oskarrough
Copy link
Member Author

How do we know which images to delete?

1. Get all live images --> https://radio4000.firebaseio.com/channels.json
2. Get all images from cloudinary --> how?
3. Compare the two lists and delete every image on Cloudinary not matching one from 1)

@4www
Copy link
Contributor

4www commented Sep 4, 2019

Let's close this and discuss cloudinary image cleaning more in details in the appropriate channel

@4www 4www closed this as completed Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants