Commit graph

127 commits

Author SHA1 Message Date
aab61631a3 Directly append complete_scrobble in upload.zig
Thanks bob :)
2025-05-25 16:16:18 -04:00
7f3778e82f Move SQL logic to separate function
Idk if this makes any sense, and I don't really like the code atm, but the view .zig files lookk nicer?
2025-05-24 13:59:28 -04:00
09f542e26e Add timescale partial
Bad name, idk what else to call it
2025-05-24 13:58:31 -04:00
1734e6a4bb Fix date formatting in scrobble view 2025-05-20 16:29:53 -04:00
d6a638bf27 Merge remote-tracking branch 'refs/remotes/origin/rawsql' into rawsql 2025-05-20 15:10:49 -04:00
a2a739bc9c Refactor upload.zig
I have been unhappy with the branches, but didn't quite know what to do about it. THis feels much nicer. Also fixes datetime stuff with jetquery.  The HTML element parsing isn't quite where I want it to be, but it works for the time being.
2025-05-20 15:07:51 -04:00
6494bbdf60 Remove Rules type 2025-05-20 09:33:15 -04:00
4c759433d2 Update README.md 2025-05-16 05:06:59 +00:00
614607ae71 Fix LastFM uploadig error
I figured it out; if you have a song currently being played, then it doesn't have a date
2025-05-16 01:05:32 -04:00
5697f95355 Fix LastFM uploading errors
Not sure which of these actually made it work, will probably work backwards at some point to reverse engineer it
2025-05-15 20:23:53 -04:00
89e98c7a47 Allow uploads from LastFM API
Very slow at the moment. Look into ways to speed this up
2025-05-15 20:23:12 -04:00
f69ffb2b37 Move upload.zig to the new table partial 2025-05-15 20:22:34 -04:00
52fefc9ba5 Create dateCompare function
Will eventually try to move away from zeit. Don't need all of it's functionality as long as SQL can format dates
2025-05-15 20:22:09 -04:00
4991bac9a4 Add LastFM scrobble type
In preparation for importing via LastFM api
2025-05-15 15:39:21 -04:00
c42b8d24dd Fix typo 2025-05-15 15:37:21 -04:00
365b9dbf11 Switch to using newtable partial for all tables
Will be renamed eventually, don't care right now. Also cleans up a lot of code I wasn't particularly happy about
2025-05-13 14:24:14 -04:00
153ea869e0 Work on making partials for views 2025-05-08 18:17:45 -04:00
4758885c68 Keep cleaning 2025-05-05 13:09:16 -04:00
9ffc45b207 Delete common_queries.md
No longer relevant
2025-05-05 11:15:30 -04:00
94cc6e3bd5 Remove unused views and functions 2025-05-05 11:06:52 -04:00
c574885f8d Get rid of unused views 2025-05-05 10:37:18 -04:00
762a4fd51e Create partial for view agnostic table 2025-05-02 10:00:47 -04:00
3345b20f1f Make an ordinal formatting funcrion
I am hungry
2025-04-29 00:38:20 -04:00
78e416eeaf Add more information to scrobbles views and refactor artists view 2025-04-28 23:06:21 -04:00
8138e5ccf2 Create dateFmt function
It's easier to keep the date as an epoch in PostgreSQL to do comparisons, but I always want to show it to the user as a formatted date
2025-04-28 23:03:24 -04:00
ae85f94ddb Switch dates from u64 to i64
PostgreSQL only uses signed ints, so this makes things much easier
2025-04-28 23:01:34 -04:00
cb89a3e6f3 Switch dates from i128 to u64
I was making them unnecessarily large by accidentally storing them as microseconds instead of milliseconds. Might be able to get away with seconds in the future
2025-04-28 21:37:08 -04:00
65136a44d6 Add more information to artists view, songs view, and format dates correctly in scrobbles view 2025-04-27 23:58:50 -04:00
01fe10f045 Fix limit on rule parameters and fix segfault in applyScrobbleRule
For sure this time
2025-04-27 16:27:03 -04:00
18d4df0a5c Fix albums not being hashed correctly
Also provides more actions for rules, but they don't seem to work...
2025-04-27 15:48:47 -04:00
5e58e81ca7 Fix album artist parsing in process_scrobbles 2025-04-27 14:28:39 -04:00
9df8f9ea12 Fix segfault in applyScrobbleRule
Thanks bob :)
2025-04-27 10:41:42 -04:00
be8c1191b0 Clean 2025-04-24 09:34:34 -04:00
0631ded115 Work on add artist action in rules
Really close to having it work, but there seems to be an error when uploading files, which causes particularly annoying problems on WSL when testing, so I'm commiting and trying on my desktop.
2025-04-23 19:32:32 -04:00
e9c72041a5 Allow multiple conditions in rules.
Scrobble processing appears noticeably slower (according to the logs), so I think rules are going to be something to optimize later. Fortunately, they shouldn't need to be applied too often
2025-04-22 13:50:39 -04:00
77170a1e28 Move Scrobble rule application to upload.zig
They couldn't see the changes made by rules after uploading Scrobbles which made it seem like the rules weren't being applied. Also makes Album rules easier to apply I believe.
2025-04-21 16:41:40 -04:00
87a2fe2d34 Complete preliminary find and replace rules
Tested by replacing AJR with John Van Derwood. Need to test on albums and artists, as well as matching on one piece of metadata, and replacing another
2025-04-21 12:23:20 -04:00
445ca45fa9 Begin rule application
The more I think about this, the more I think it's gonna be super slow and bad. There must bve a good way of doing this, but I'm not sure how...
2025-04-21 00:17:16 -04:00
baf9ef38a4 Simplify file creation branch of process_rule.zig
Still not quite where I want it, but definitely better than what it was
2025-04-19 15:36:51 -04:00
5383b69eb6 Allow reading and writing rules.json
I like the idea of letting the user write to a file themselves for rules, but I think this is going to significantly slow things down. Will probably switch to SQL table at some point. Also very hardcoded for my purposes. ALSO  the code looks bad, I think there must be a better way...
2025-04-19 15:01:30 -04:00
18cdb48b53 Begin rules 2025-04-18 21:29:00 -04:00
ff8cdabbf1 Cleanup 2025-04-17 15:28:00 -04:00
387493d3c0 Change typedef of prev_artist_infos
Feeling much better about my choices this time around
2025-04-17 15:17:10 -04:00
4d63844def Make artist retrieval apart of main query
This feels bad or wrong somehow, but it do be working tho
2025-04-17 15:05:44 -04:00
2c4af0b378 Include artist column for albums
I'm convinced there's a better way of doing this, but this is all I can think of right now
2025-04-17 14:05:15 -04:00
41ab0dc888 Remove artists column from views
I kinda just didn't want to deal with it while implementing the raw sql. Bringing it back is my next priority, but I want to do the searching in a nice way, and I'm not sure how to do that yet
2025-04-17 00:26:56 -04:00
27358fe217 Implement db searches using raw sql 2025-04-17 00:24:48 -04:00
09d4453665 Fix various issues with process_scrobbles
I use the ins_ variables an unnecessary amount I think, I need to take a closer look at it, and give them better names
2025-04-17 00:24:16 -04:00
3f69183b6f Create new Schema from migrations 2025-04-17 00:23:12 -04:00
64038079d8 Update process_scrobbles.zig to fit new db 2025-04-07 15:44:52 -04:00