def main():
r = redis.Redis(host="localhost", port="6379", decode_responses=True)
+ with open("song-map.csv", "r") as mapcsv:
+ all = mapcsv.readlines()
+
for i in range(0, 100):
+ line = all[i].split(",")
r.hmset(f"song:{i}", {
- "artistName": "firstartist~secondartist",
- "trackName": "hot n cold",
+ "artistName": line[0],
+ "trackName": line[2],
"trackViewUrl": "http:///somehwere",
"previewUrl": "http://somewhere",
"artworkUrl60": "http://somewhere",
"artworkUrl100": "http://somewhere",
- "displayArtistNames": "firstartist, secondartist",
- "displayTrackName": "Hot n cold",
+ "displayArtistNames": line[1],
+ "displayTrackName": line[3],
})
r.zadd("hits", {i: i})