Switch dates from u64 to i64
PostgreSQL only uses signed ints, so this makes things much easier
This commit is contained in:
parent
cb89a3e6f3
commit
ae85f94ddb
3 changed files with 4 additions and 4 deletions
|
|
@ -33,7 +33,7 @@ pub fn run(allocator: std.mem.Allocator, params: *jetzig.data.Value, env: jetzig
|
|||
.artists_track = track_artist_name_buffer,
|
||||
.album = item.getT(.string, "album") orelse "",
|
||||
.artists_album = album_artist_name_buffer,
|
||||
.date = @as(u64, @bitCast(@as(i64, @truncate(item.getT(.integer, "date").?)))),
|
||||
.date = @as(i64, @truncate(item.getT(.integer, "date").?)),
|
||||
};
|
||||
|
||||
var id_prehash = std.ArrayList(u8).init(allocator);
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ pub fn post(request: *jetzig.Request) !jetzig.View {
|
|||
.track = scrobble.master_metadata_track_name.?,
|
||||
.album = scrobble.master_metadata_album_album_name.?,
|
||||
.artist = scrobble.master_metadata_album_artist_name.?,
|
||||
.date = @as(u64, @bitCast((try zeit.instant(.{ .source = .{ .iso8601 = scrobble.ts } })).unixTimestamp() * 1000)),
|
||||
.date = (try zeit.instant(.{ .source = .{ .iso8601 = scrobble.ts } })).unixTimestamp() * 1000,
|
||||
};
|
||||
|
||||
const formatted_scrobble = if (rule_list) |rl|
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ pub const ImportedScrobble = struct {
|
|||
track: []const u8,
|
||||
artist: []const u8,
|
||||
album: []const u8 = "",
|
||||
date: u64,
|
||||
date: i64,
|
||||
};
|
||||
|
||||
pub const Scrobble = struct {
|
||||
|
|
@ -10,7 +10,7 @@ pub const Scrobble = struct {
|
|||
artists_track: []const []const u8,
|
||||
album: []const u8 = "",
|
||||
artists_album: []const []const u8,
|
||||
date: u64,
|
||||
date: i64,
|
||||
};
|
||||
|
||||
// From lastfmstats.com
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue