diff --git a/src/app/views/scrobbles.zig b/src/app/views/scrobbles.zig index 8125efd..095f8a9 100644 --- a/src/app/views/scrobbles.zig +++ b/src/app/views/scrobbles.zig @@ -7,8 +7,12 @@ pub fn index(request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { } pub fn get(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = data; - _ = id; + var root = try request.data(.object); + const params = try request.params(); + if (params.get("ar")) |param| { + const artists = try jetzig.database.Query(.Artists).select(.{.id, .name}); + const + } return request.render(.ok); } diff --git a/src/app/views/scrobbles/index.zmpl b/src/app/views/scrobbles/index.zmpl index 9bf7e31..48b753a 100644 --- a/src/app/views/scrobbles/index.zmpl +++ b/src/app/views/scrobbles/index.zmpl @@ -1,8 +1,16 @@ + + + @partial partials/header
- Content goes here + Look for an artist
+
+ + + +
diff --git a/src/app/views/upload.zig b/src/app/views/upload.zig index 7d15f62..53f3b27 100644 --- a/src/app/views/upload.zig +++ b/src/app/views/upload.zig @@ -1,9 +1,6 @@ const std = @import("std"); const jetzig = @import("jetzig"); const jetquery = @import("jetzig").jetquery; -//const Scrobble = @import("../../types.zig").LastFMScrobble; -//const lastfm = @import("../../types.zig").LastFM; -//const UploadData = @import("../../types").UploadData; const ScrobbleTypes = @import("../../types.zig"); const zeit = @import("zeit"); @@ -24,7 +21,6 @@ pub fn post(request: *jetzig.Request) !jetzig.View { if (try request.file("upload")) |file| { const params = try request.params(); const source = try std.fmt.parseInt(u8, params.get("t").?.string.value, 10); // This param is required in HTML - // Date limiting is broken atm const before_limiter: bool = if (params.get("bbool")) |_| true else false; const after_limiter: bool = if (params.get("abool")) |_| true else false; @@ -85,8 +81,6 @@ pub fn post(request: *jetzig.Request) !jetzig.View { continue :appends; } - // I'm separating these on account of the above comment, as well as - // this part being kinda complicated const iso_ts = try zeit.Time.fromISO8601(scrobble.ts); if ((before_limiter or after_limiter) and (iso_ts.after(before_limiting_date) or iso_ts.before(after_limiting_date))) { limited_tracks += 1; diff --git a/src/app/views/upload/index.zmpl b/src/app/views/upload/index.zmpl index 7b45aad..9043a5b 100644 --- a/src/app/views/upload/index.zmpl +++ b/src/app/views/upload/index.zmpl @@ -8,8 +8,6 @@ Upload Last.fm or Spotify history file here (in json format).
- -