]> git.example.dev Git - binbsis50-sm.git/commitdiff
updated: loading script to more accurately reflect db
author2weiEmu <saalbach.robert@outlook.de>
Thu, 12 Mar 2026 11:46:25 +0000 (12:46 +0100)
committer2weiEmu <saalbach.robert@outlook.de>
Thu, 12 Mar 2026 11:46:25 +0000 (12:46 +0100)
Makefile
pkg/dbhandling/dbhandling.go
songmanager
testing/dummy_testing_data.py

index a9aceee0d8f14cf82b678bfc279097170c7c2232..f69a8220da63b26bedb15a89cd3c4788e9a6bba1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,12 +2,12 @@
 
 default: .
        # first we must setup the test database
+       sudo docker stop redis || true
+       sudo docker rm redis || true
        sudo docker run -d --name redis -p 6379:6379 redis:latest
        
        python3 ./testing/dummy_testing_data.py
        # now we can run the main app with the right arguments
        go build .
-       ./songmanager -port 8000 -binb_location="" -songs_location="" -redis_location="localhost:6379" -container_name="" || true
+       ./songmanager -port 8000 -binb_location="" -songs_location="" -redis_location="localhost:6379" -container_name=""
 
-       docker stop redis || true
-       docker rm redis || true
index 9111ba9aaf07b939b2a3c6c952d6bf002365fe5e..bc551c40df6b6145d58d28631f5682d2560c9690 100644 (file)
@@ -3,11 +3,16 @@ package dbhandling
 import (
        "context"
        "encoding/json"
+       "fmt"
        "net/http"
 
        "github.com/redis/go-redis/v9"
 )
 
+type DBSong struct {
+
+}
+
 type DBStatusMessage struct {
        TotalSongCount int
 }
@@ -39,6 +44,7 @@ func (dbw *DBWrapper) GetDBStatus(w http.ResponseWriter, r *http.Request) {
        if err != nil {
                panic(err)
        }
+       fmt.Println(keys)
        key_count := len(keys)
 
        m := DBStatusMessage{
index 07965293f111cccd5028d7907e94d1815e973a02..64fb0a77c1a6773fbb05f196d987a3f151381c46 100755 (executable)
Binary files a/songmanager and b/songmanager differ
index 3dd24c2f591d3c551da09729693bb2c6f1912f9d..a80a69877efffeca5e4c30fe4e0ef7565efcd93e 100644 (file)
@@ -6,11 +6,35 @@ def main():
 
     for i in range(0, 100):
         r.hmset(f"song:{i}", {
-            "artistNames": "firstartist, secondartist",
-            "songNames": "firstsongname, secondsongname"
+            "artistName": "firstartist~secondartist",
+            "trackName": "hot n cold",
+            "trackViewUrl": "http:///somehwere",
+            "previewUrl": "http://somewhere",
+            "artworkUrl60": "http://somewhere",
+            "artworkUrl100": "http://somewhere",
+            "displayArtistNames": "firstartist, secondartist",
+            "displayTrackName": "Hot n cold",
         })
         r.zadd("hits", {i: i})
 
+    # 'song:' + i,
+    # 'artistName',
+    # artistValues,
+    # 'trackName',
+    # trackNames,
+    # 'trackViewUrl',
+    # viewUrl,
+    # 'previewUrl',
+    # previewName,
+    # 'artworkUrl60',
+    # "",
+    # 'artworkUrl100',
+    # '',
+    # 'displayArtistNames',
+    # displayArtist,
+    # 'displayTrackName',
+    # displayTrack,
+
 
 if __name__ == "__main__":
     main()