Prepare
This commit is contained in:
parent
e45599e9ec
commit
d32c6cc594
3 changed files with 14 additions and 2 deletions
13
src/json.zig
13
src/json.zig
|
@ -3,7 +3,7 @@ const std = @import("std");
|
||||||
const dbg_print = std.debug.print;
|
const dbg_print = std.debug.print;
|
||||||
|
|
||||||
|
|
||||||
pub fn extract(allocator: std.mem.Allocator, json_string: []const u8) !void {
|
pub fn decode_song_data(allocator: std.mem.Allocator, json_string: []const u8) !void {
|
||||||
const parsed = try std.json.parseFromSlice(
|
const parsed = try std.json.parseFromSlice(
|
||||||
std.json.Value,
|
std.json.Value,
|
||||||
allocator,
|
allocator,
|
||||||
|
@ -32,3 +32,14 @@ pub fn extract(allocator: std.mem.Allocator, json_string: []const u8) !void {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn decode_album_data() void {
|
||||||
|
unreachable;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn decode_track_results() void {
|
||||||
|
unreachable;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn decode_album_results() void {
|
||||||
|
unreachable;
|
||||||
|
}
|
||||||
|
|
|
@ -24,6 +24,6 @@ pub fn main() !void {
|
||||||
const data = try url.fetch(allocator, "https://tidal.401658.xyz/track/?id=286266927&quality=LOSSLESS");
|
const data = try url.fetch(allocator, "https://tidal.401658.xyz/track/?id=286266927&quality=LOSSLESS");
|
||||||
defer allocator.free(data);
|
defer allocator.free(data);
|
||||||
|
|
||||||
try json.extract(allocator, data);
|
try json.decode_song_data(allocator, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,3 +32,4 @@ pub fn fetch(allocator: std.mem.Allocator, url: []const u8) ![]u8 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue