w0rd-driven / beatseek

Seek the music you may be missing by analyzing your collection
https://beatseek.fly.dev/
MIT License
3 stars 0 forks source link

Artist count badge #5

Closed w0rd-driven closed 1 year ago

w0rd-driven commented 1 year ago

The chance of this updating in real-time is so slim.

w0rd-driven commented 1 year ago

Upserts make it damn impossible to determine if something was new. Ecto change sets don't appear to show the insert/update action. Upserts also set completely new time stamps as a template per suggestions.

I feel like I have to be missing something here or I should give up on upserts entirely. I could always take the approach I've implemented before of batching I stole from marcdel's jira_tracker (https://github.com/marcdel/jira_tracker/blob/main/lib/jira_tracker/persistence/icebox.ex#L49-L59). It does keep track and trap errors to determine what was saved. In my case I always want a create_or_get like what was implemented and I may try to use Laravel's findOrCreate nomenclature instead. I also see a Repo.get_by I could likely use instead of Repo.all then filter or whatever shenanigans I'm using.

I can always keep the upsert functions to show I knew them.

w0rd-driven commented 1 year ago

PubSub is implemented on the subscriber end. I'm also recognizing how brittle these components are from a layout perspective. They're very much coupled to the parent container and set ml-auto and padding accordingly. Ideally, the container would take care of placement where only padding or height adjustments would be necessary. When I go through the step of finding comparable Tailwind UI components, this will likely change or possibly not. It isn't insignificant work to refactor this when I look at the milestone as a whole.