Compare commits

...

89 Commits

Author SHA1 Message Date
11e5b1745c tsk-59 (#70)
All checks were successful
Rust Build / Check (push) Successful in 33s
Rust Build / Rustfmt (push) Successful in 34s
Rust Build / Test Suite (push) Successful in 1m19s
Rust Build / Clippy (push) Successful in 36s
Rust Build / build (push) Successful in 1m31s
Closes #59

Reviewed-on: #70
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-10-12 20:44:23 +00:00
4e649fa390 Dependency update (#69)
All checks were successful
Rust Build / Check (push) Successful in 33s
Rust Build / Rustfmt (push) Successful in 32s
Rust Build / Test Suite (push) Successful in 1m13s
Rust Build / Clippy (push) Successful in 40s
Rust Build / build (push) Successful in 50s
Reviewed-on: #69
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-10-12 20:34:46 +00:00
668d371f7f Merge pull request 'Coverart changes' (#65) from coverart_changes into main
All checks were successful
Rust Build / Check (push) Successful in 32s
Rust Build / Rustfmt (push) Successful in 32s
Rust Build / Clippy (push) Successful in 31s
Rust Build / build (push) Successful in 31s
Rust Build / Test Suite (push) Successful in 33s
Release Tagging / release (pull_request) Successful in 31s
Rust Build / Check (pull_request) Successful in 30s
Rust Build / Test Suite (pull_request) Successful in 12m55s
Rust Build / Rustfmt (pull_request) Successful in 26m11s
Rust Build / Clippy (pull_request) Successful in 36s
Rust Build / build (pull_request) Successful in 35s
Reviewed-on: #65
2025-10-11 22:18:24 +00:00
eac7562b80 Coverart remove file (#68)
All checks were successful
Release Tagging / release (pull_request) Successful in 31s
Rust Build / Check (pull_request) Successful in 31s
Rust Build / Test Suite (pull_request) Successful in 34s
Rust Build / Rustfmt (pull_request) Successful in 32s
Rust Build / Clippy (pull_request) Successful in 33s
Rust Build / build (pull_request) Successful in 31s
Reviewed-on: #68
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-10-11 22:14:10 +00:00
e3ca2c5781 Coverart save to filesystem (#67)
All checks were successful
Release Tagging / release (pull_request) Successful in 36s
Rust Build / Check (pull_request) Successful in 41s
Rust Build / Test Suite (pull_request) Successful in 43s
Rust Build / Rustfmt (pull_request) Successful in 32s
Rust Build / Clippy (pull_request) Successful in 2m12s
Rust Build / build (pull_request) Successful in 2m18s
Reviewed-on: #67
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-10-11 20:30:39 +00:00
440caca7c2 Moved to_data (#66)
Some checks failed
Rust Build / Check (pull_request) Successful in 33s
Release Tagging / release (pull_request) Successful in 36s
Rust Build / Test Suite (pull_request) Successful in 45s
Rust Build / Rustfmt (pull_request) Successful in 33s
Rust Build / Clippy (pull_request) Failing after 44s
Rust Build / build (pull_request) Successful in 1m7s
Reviewed-on: #66
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-10-11 20:11:39 +00:00
0c0b4ba7ca Merge pull request 'Song changes' (#60) from song_changes into main
Some checks failed
Rust Build / Check (push) Successful in 30s
Rust Build / Rustfmt (push) Successful in 33s
Rust Build / Test Suite (push) Successful in 39s
Rust Build / Clippy (push) Failing after 36s
Rust Build / build (push) Successful in 35s
Rust Build / Check (pull_request) Successful in 32s
Release Tagging / release (pull_request) Failing after 36s
Rust Build / Test Suite (pull_request) Successful in 34s
Rust Build / Rustfmt (pull_request) Successful in 32s
Rust Build / build (pull_request) Successful in 31s
Rust Build / Clippy (pull_request) Failing after 34s
Reviewed-on: #60
2025-10-11 19:49:52 +00:00
c263cedf28 Remove song (#64)
Some checks failed
Release Tagging / release (pull_request) Successful in 33s
Rust Build / Check (pull_request) Successful in 43s
Rust Build / Test Suite (pull_request) Successful in 44s
Rust Build / Rustfmt (pull_request) Successful in 32s
Rust Build / Clippy (pull_request) Failing after 32s
Rust Build / build (pull_request) Successful in 38s
Reviewed-on: #64
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-10-11 19:46:00 +00:00
0637a9432e Changes to how song filenames are generated (#63)
Some checks failed
Rust Build / Test Suite (pull_request) Successful in 35s
Rust Build / Check (pull_request) Successful in 38s
Release Tagging / release (pull_request) Successful in 48s
Rust Build / Rustfmt (pull_request) Failing after 33s
Rust Build / Clippy (pull_request) Successful in 34s
Rust Build / build (pull_request) Successful in 35s
Reviewed-on: #63
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-10-11 19:20:57 +00:00
d7c078d95a Song to_data change (#62)
All checks were successful
Rust Build / Check (pull_request) Successful in 35s
Release Tagging / release (pull_request) Successful in 43s
Rust Build / Test Suite (pull_request) Successful in 46s
Rust Build / Rustfmt (pull_request) Successful in 33s
Rust Build / build (pull_request) Successful in 33s
Rust Build / Clippy (pull_request) Successful in 50s
Reviewed-on: #62
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-10-11 19:02:01 +00:00
00cada74e2 Copy song (#61)
Some checks failed
Rust Build / Check (pull_request) Successful in 42s
Release Tagging / release (pull_request) Successful in 44s
Rust Build / Test Suite (pull_request) Failing after 1m2s
Rust Build / Rustfmt (pull_request) Successful in 30s
Rust Build / Clippy (pull_request) Successful in 36s
Rust Build / build (pull_request) Successful in 50s
Reviewed-on: #61
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-10-11 18:53:13 +00:00
9436c9033a Added todo
All checks were successful
Release Tagging / release (pull_request) Successful in 44s
Rust Build / Test Suite (pull_request) Successful in 49s
Rust Build / Check (pull_request) Successful in 57s
Rust Build / Rustfmt (pull_request) Successful in 29s
Rust Build / Clippy (pull_request) Successful in 47s
Rust Build / build (pull_request) Successful in 59s
2025-10-11 14:23:23 -04:00
85d8f839f1 Code formatting
All checks were successful
Rust Build / Test Suite (pull_request) Successful in 1m38s
Rust Build / Rustfmt (pull_request) Successful in 32s
Release Tagging / release (pull_request) Successful in 2m17s
Rust Build / Check (pull_request) Successful in 2m30s
Rust Build / Clippy (pull_request) Successful in 57s
Rust Build / build (pull_request) Successful in 1m1s
2025-10-11 14:19:45 -04:00
16f633d563 Added test 2025-10-11 14:19:30 -04:00
0b53eb8208 Added more todos 2025-10-11 14:19:21 -04:00
73c8fd2634 Tweaked some changes 2025-10-11 14:17:32 -04:00
fa8643e73a Added function to save song to the filesystem 2025-10-11 14:08:20 -04:00
2d6b550ae6 tsk-57: Adding derive Schema to models (#58)
All checks were successful
Rust Build / Check (push) Successful in 31s
Rust Build / Test Suite (push) Successful in 1m0s
Rust Build / Rustfmt (push) Successful in 31s
Rust Build / Clippy (push) Successful in 37s
Rust Build / build (push) Successful in 46s
Closes #57

Reviewed-on: #58
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-08-24 23:42:04 +00:00
f43bcaa314 Merge pull request 'Release' (#50) from devel into main
All checks were successful
Rust Build / Test Suite (push) Successful in 35s
Rust Build / Rustfmt (push) Successful in 1s
Rust Build / Check (push) Successful in 14s
Rust Build / build (push) Successful in 9s
Rust Build / Clippy (push) Successful in 52s
Reviewed-on: #50
2025-08-17 18:36:04 +00:00
a6ef7d8a62 Removed devel branch references (#56)
All checks were successful
Release Tagging / release (pull_request) Successful in 10s
Rust Build / Check (pull_request) Successful in 12s
Rust Build / Test Suite (pull_request) Successful in 1m3s
Rust Build / Rustfmt (pull_request) Successful in -6s
Rust Build / Clippy (pull_request) Successful in 9s
Rust Build / build (pull_request) Successful in 53s
Reviewed-on: #56
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-08-17 18:31:05 +00:00
bd793db08e Add Id to token (#55)
All checks were successful
Release Tagging / release (push) Successful in 39s
Rust Build / Check (push) Successful in 41s
Rust Build / Rustfmt (push) Successful in 36s
Rust Build / Test Suite (push) Successful in 37s
Rust Build / Clippy (push) Successful in 33s
Rust Build / build (push) Successful in 34s
Rust Build / Test Suite (pull_request) Successful in 31s
Rust Build / Check (pull_request) Successful in 33s
Rust Build / Clippy (pull_request) Successful in 31s
Rust Build / Rustfmt (pull_request) Successful in 32s
Rust Build / build (pull_request) Successful in 41s
Reviewed-on: #55
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-08-06 22:45:32 +00:00
1e95822b5a tsk-51: Do not serialize path field for CoverArt (#54)
All checks were successful
Rust Build / Check (push) Successful in 30s
Release Tagging / release (push) Successful in 33s
Rust Build / Test Suite (push) Successful in 32s
Rust Build / Rustfmt (push) Successful in 31s
Rust Build / build (push) Successful in 27s
Rust Build / Clippy (push) Successful in 32s
Rust Build / Test Suite (pull_request) Successful in 30s
Rust Build / Check (pull_request) Successful in 27s
Rust Build / Rustfmt (pull_request) Successful in 30s
Rust Build / Clippy (pull_request) Successful in 38s
Rust Build / build (pull_request) Successful in 28s
Reviewed-on: #54
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-08-01 20:18:09 +00:00
228ca67a16 Create token refactor (#53)
All checks were successful
Rust Build / Check (push) Successful in 29s
Release Tagging / release (push) Successful in 31s
Rust Build / Test Suite (push) Successful in 29s
Rust Build / Rustfmt (push) Successful in 30s
Rust Build / Clippy (push) Successful in 27s
Rust Build / build (push) Successful in 32s
Rust Build / Check (pull_request) Successful in 25s
Rust Build / Test Suite (pull_request) Successful in 32s
Rust Build / Rustfmt (pull_request) Successful in 25s
Rust Build / Clippy (pull_request) Successful in 32s
Rust Build / build (pull_request) Successful in 30s
Reviewed-on: #53
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-08-01 20:04:33 +00:00
d3251f935e add create token function (#52)
All checks were successful
Rust Build / Check (push) Successful in 31s
Release Tagging / release (push) Successful in 35s
Rust Build / Rustfmt (push) Successful in 30s
Rust Build / Test Suite (push) Successful in 40s
Rust Build / Clippy (push) Successful in 32s
Rust Build / build (push) Successful in 30s
Rust Build / Check (pull_request) Successful in 36s
Rust Build / Test Suite (pull_request) Successful in 44s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / build (pull_request) Successful in 30s
Rust Build / Clippy (pull_request) Successful in 45s
Reviewed-on: #52
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-07-31 01:13:02 +00:00
1c5de9dc26 coverart add song_id (#49)
All checks were successful
Rust Build / Check (push) Successful in 26s
Release Tagging / release (push) Successful in 32s
Rust Build / Test Suite (push) Successful in 32s
Rust Build / Rustfmt (push) Successful in 29s
Rust Build / Clippy (push) Successful in 28s
Rust Build / build (push) Successful in 29s
Rust Build / Test Suite (pull_request) Successful in 26s
Rust Build / Check (pull_request) Successful in 30s
Rust Build / Rustfmt (pull_request) Successful in 27s
Rust Build / Clippy (pull_request) Successful in 32s
Rust Build / build (pull_request) Successful in 34s
Reviewed-on: #49
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-07-26 16:35:51 +00:00
569fb632e5 Merge pull request 'v0.5.X release' (#41) from devel into main
All checks were successful
Rust Build / Check (push) Successful in 26s
Rust Build / Test Suite (push) Successful in 30s
Rust Build / Rustfmt (push) Successful in 30s
Rust Build / Clippy (push) Successful in 31s
Rust Build / build (push) Successful in 27s
Reviewed-on: #41
2025-07-23 21:59:40 +00:00
7839c64561 Version bump (#48)
All checks were successful
Release Tagging / release (push) Successful in 28s
Rust Build / Check (push) Successful in 28s
Rust Build / Test Suite (push) Successful in 27s
Rust Build / Rustfmt (push) Successful in 25s
Rust Build / Clippy (push) Successful in 27s
Rust Build / build (push) Successful in 30s
Rust Build / Check (pull_request) Successful in 27s
Rust Build / Test Suite (pull_request) Successful in 26s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / Clippy (pull_request) Successful in 26s
Rust Build / build (pull_request) Successful in 25s
Reviewed-on: #48
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-07-23 21:54:10 +00:00
655d05dabb Coverart ignore data for json usage (#47)
All checks were successful
Release Tagging / release (push) Successful in 30s
Rust Build / Check (push) Successful in 25s
Rust Build / Test Suite (push) Successful in 27s
Rust Build / Rustfmt (push) Successful in 26s
Rust Build / Clippy (push) Successful in 28s
Rust Build / build (push) Successful in 27s
Rust Build / Check (pull_request) Successful in 29s
Rust Build / Test Suite (pull_request) Successful in 28s
Rust Build / Rustfmt (pull_request) Successful in 25s
Rust Build / Clippy (pull_request) Successful in 27s
Rust Build / build (pull_request) Successful in 29s
Reviewed-on: #47
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-07-14 23:57:00 +00:00
7958b89abc Update readme (#46)
All checks were successful
Release Tagging / release (push) Successful in 30s
Rust Build / Check (push) Successful in 26s
Rust Build / Test Suite (push) Successful in 28s
Rust Build / Rustfmt (push) Successful in 27s
Rust Build / Clippy (push) Successful in 29s
Rust Build / build (push) Successful in 27s
Rust Build / Check (pull_request) Successful in 38s
Rust Build / Test Suite (pull_request) Successful in 40s
Rust Build / Rustfmt (pull_request) Successful in 27s
Rust Build / Clippy (pull_request) Successful in 52s
Rust Build / build (pull_request) Successful in 43s
Reviewed-on: #46
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-06-29 18:14:18 +00:00
c0d23e0640 Version bump (#45)
All checks were successful
Rust Build / Check (push) Successful in 28s
Rust Build / Test Suite (push) Successful in 29s
Rust Build / Rustfmt (push) Successful in 26s
Rust Build / Clippy (push) Successful in 26s
Rust Build / build (push) Successful in 28s
Release Tagging / release (push) Successful in 31s
Rust Build / Check (pull_request) Successful in 25s
Rust Build / Test Suite (pull_request) Successful in 27s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / Clippy (pull_request) Successful in 28s
Rust Build / build (pull_request) Successful in 28s
Reviewed-on: #45
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-06-29 18:02:23 +00:00
1a64b512f4 Removing some code (#44)
All checks were successful
Release Tagging / release (push) Successful in 30s
Rust Build / Check (push) Successful in 28s
Rust Build / Test Suite (push) Successful in 27s
Rust Build / Rustfmt (push) Successful in 25s
Rust Build / Clippy (push) Successful in 28s
Rust Build / build (push) Successful in 27s
Rust Build / Check (pull_request) Successful in 28s
Rust Build / Test Suite (pull_request) Successful in 28s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / Clippy (pull_request) Successful in 28s
Rust Build / build (pull_request) Successful in 26s
Taking out code that wasn't being used and was commented.

Reviewed-on: #44
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-06-29 17:54:23 +00:00
e5082ea07d Updated dependencies (#43)
All checks were successful
Rust Build / Check (push) Successful in 25s
Rust Build / Test Suite (push) Successful in 26s
Rust Build / Rustfmt (push) Successful in 24s
Rust Build / Clippy (push) Successful in 27s
Rust Build / build (push) Successful in 25s
Rust Build / Check (pull_request) Successful in 25s
Rust Build / Test Suite (pull_request) Successful in 27s
Release Tagging / release (push) Successful in 29s
Rust Build / Rustfmt (pull_request) Successful in 27s
Rust Build / Clippy (pull_request) Successful in 28s
Rust Build / build (pull_request) Successful in 27s
serde, serde_json, rand, uuid, and tempfile

Reviewed-on: #43
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-06-29 17:46:12 +00:00
f37c445908 rust std change (#42)
Some checks failed
Release Tagging / release (push) Failing after 29s
Rust Build / Rustfmt (push) Successful in 25s
Rust Build / Clippy (push) Successful in 26s
Rust Build / build (push) Successful in 24s
Rust Build / Check (pull_request) Successful in 27s
Rust Build / Test Suite (pull_request) Successful in 26s
Rust Build / build (pull_request) Successful in 26s
Rust Build / Check (push) Successful in 26s
Rust Build / Test Suite (push) Successful in 27s
Rust Build / Rustfmt (pull_request) Successful in 25s
Rust Build / Clippy (pull_request) Successful in 26s
Reviewed-on: #42
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-06-29 17:37:13 +00:00
6aa4c3d741 Merge pull request 'Next release' (#38) from devel into main
All checks were successful
Release Tagging / release (push) Successful in 42s
Rust Build / Check (push) Successful in 33s
Rust Build / Test Suite (push) Successful in 39s
Rust Build / Rustfmt (push) Successful in 31s
Rust Build / Clippy (push) Successful in 37s
Rust Build / build (push) Successful in 30s
Rust Build / Check (pull_request) Successful in 27s
Rust Build / Test Suite (pull_request) Successful in 25s
Rust Build / Rustfmt (pull_request) Successful in 25s
Rust Build / Clippy (pull_request) Successful in 27s
Rust Build / build (pull_request) Successful in 26s
Reviewed-on: #38
2025-04-10 23:49:19 +00:00
47475639b0 Version bump (#40)
All checks were successful
Release Tagging / release (push) Successful in 47s
Rust Build / Check (push) Successful in 32s
Rust Build / Test Suite (push) Successful in 40s
Rust Build / Rustfmt (push) Successful in 32s
Rust Build / Clippy (push) Successful in 39s
Rust Build / build (push) Successful in 33s
Rust Build / Check (pull_request) Successful in 40s
Rust Build / Test Suite (pull_request) Successful in 42s
Rust Build / Rustfmt (pull_request) Successful in 25s
Rust Build / Clippy (pull_request) Successful in 40s
Rust Build / build (pull_request) Successful in 39s
Reviewed-on: #40
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-04-10 23:28:00 +00:00
73c17840ff Implemented functionality and wrote test for checking token scope (#39)
All checks were successful
Release Tagging / release (push) Successful in 54s
Rust Build / Check (push) Successful in 40s
Rust Build / Test Suite (push) Successful in 34s
Rust Build / Rustfmt (push) Successful in 36s
Rust Build / Clippy (push) Successful in 31s
Rust Build / build (push) Successful in 37s
Rust Build / Check (pull_request) Successful in 28s
Rust Build / Test Suite (pull_request) Successful in 41s
Rust Build / Rustfmt (pull_request) Successful in 33s
Rust Build / Clippy (pull_request) Successful in 37s
Rust Build / build (pull_request) Successful in 27s
Reviewed-on: #39
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-04-10 22:30:01 +00:00
2dbed9fec9 token_type_change (#37)
All checks were successful
Release Tagging / release (push) Successful in 33s
Rust Build / Check (push) Successful in 29s
Rust Build / Test Suite (push) Successful in 38s
Rust Build / Rustfmt (push) Successful in 31s
Rust Build / Clippy (push) Successful in 38s
Rust Build / build (push) Successful in 29s
Rust Build / Check (pull_request) Successful in 30s
Rust Build / Test Suite (pull_request) Successful in 37s
Rust Build / Rustfmt (pull_request) Successful in 29s
Rust Build / Clippy (pull_request) Successful in 36s
Rust Build / build (pull_request) Successful in 31s
Reviewed-on: #37
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-04-09 02:38:20 +00:00
97853a42c1 Merge pull request 'workflow_tag_fix (#33)' (#34) from devel into main
All checks were successful
Release Tagging / release (push) Successful in 32s
Rust Build / Check (push) Successful in 28s
Rust Build / Test Suite (push) Successful in 32s
Rust Build / Rustfmt (push) Successful in 32s
Rust Build / Clippy (push) Successful in 30s
Rust Build / build (push) Successful in 33s
Reviewed-on: #34
2025-04-07 01:09:43 +00:00
6467521a02 Changed expiration field of LoginResult to i64 (#36)
All checks were successful
Release Tagging / release (push) Successful in 34s
Rust Build / Check (push) Successful in 28s
Rust Build / Test Suite (push) Successful in 29s
Rust Build / Rustfmt (push) Successful in 34s
Rust Build / Clippy (push) Successful in 30s
Rust Build / build (push) Successful in 28s
Rust Build / Check (pull_request) Successful in 32s
Rust Build / Test Suite (pull_request) Successful in 31s
Rust Build / Rustfmt (pull_request) Successful in 27s
Rust Build / Clippy (pull_request) Successful in 29s
Rust Build / build (pull_request) Successful in 35s
Reviewed-on: #36
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-04-07 00:47:51 +00:00
6411133c95 workflow_tag_fix (#35)
All checks were successful
Release Tagging / release (push) Successful in 36s
Rust Build / Check (push) Successful in 31s
Rust Build / Test Suite (push) Successful in 33s
Rust Build / Rustfmt (push) Successful in 33s
Rust Build / Clippy (push) Successful in 30s
Rust Build / build (push) Successful in 31s
Rust Build / Check (pull_request) Successful in 31s
Rust Build / Test Suite (pull_request) Successful in 30s
Rust Build / Rustfmt (pull_request) Successful in 28s
Rust Build / Clippy (pull_request) Successful in 34s
Rust Build / build (pull_request) Successful in 30s
Reviewed-on: #35
Co-authored-by: phoenix <kundeng94@gmail.com>
Co-committed-by: phoenix <kundeng94@gmail.com>
2025-04-05 21:59:26 +00:00
8a08672423 workflow_tag_fix (#33)
Some checks failed
Release Tagging / release (push) Failing after 37s
Rust Build / Check (push) Successful in 28s
Rust Build / Test Suite (push) Successful in 36s
Rust Build / Rustfmt (push) Successful in 29s
Rust Build / Clippy (push) Successful in 29s
Rust Build / build (push) Successful in 34s
Rust Build / Clippy (pull_request) Successful in 32s
Rust Build / build (pull_request) Successful in 28s
Rust Build / Check (pull_request) Successful in 26s
Rust Build / Test Suite (pull_request) Successful in 29s
Rust Build / Rustfmt (pull_request) Successful in 27s
Reviewed-on: #33
Co-authored-by: phoenix <kundeng94@gmail.com>
Co-committed-by: phoenix <kundeng94@gmail.com>
2025-04-05 21:27:50 +00:00
fdae8056b1 Merge pull request 'Next release' (#30) from devel into main
All checks were successful
Rust Build / Check (push) Successful in 30s
Rust Build / Test Suite (push) Successful in 35s
Rust Build / Rustfmt (push) Successful in 29s
Rust Build / Clippy (push) Successful in 30s
Rust Build / build (push) Successful in 30s
Release Tagging / release (push) Successful in 34s
Reviewed-on: #30
2025-04-05 18:38:37 +00:00
c555110367 rust_version_bump (#32)
All checks were successful
Rust Build / Rustfmt (push) Successful in 33s
Rust Build / Rustfmt (pull_request) Successful in 27s
Rust Build / Clippy (pull_request) Successful in 27s
Rust Build / build (pull_request) Successful in 27s
Release Tagging / release (push) Successful in 37s
Rust Build / Check (push) Successful in 30s
Rust Build / Test Suite (push) Successful in 30s
Rust Build / Clippy (push) Successful in 29s
Rust Build / build (push) Successful in 29s
Rust Build / Check (pull_request) Successful in 31s
Rust Build / Test Suite (pull_request) Successful in 29s
Reviewed-on: #32
Co-authored-by: phoenix <kundeng94@gmail.com>
Co-committed-by: phoenix <kundeng94@gmail.com>
2025-04-05 18:13:28 +00:00
4b6f6cb67d rust_version (#31)
Some checks failed
Release Tagging / release (push) Failing after 31s
Rust Build / Check (push) Failing after 30s
Rust Build / Test Suite (push) Failing after 29s
Rust Build / Rustfmt (push) Successful in 27s
Rust Build / Clippy (push) Failing after 28s
Rust Build / build (push) Failing after 27s
Rust Build / Check (pull_request) Failing after 32s
Rust Build / Test Suite (pull_request) Failing after 28s
Rust Build / Rustfmt (pull_request) Successful in 27s
Rust Build / Clippy (pull_request) Failing after 33s
Rust Build / build (pull_request) Failing after 29s
Reviewed-on: #31
Co-authored-by: phoenix <kundeng94@gmail.com>
Co-committed-by: phoenix <kundeng94@gmail.com>
2025-04-05 17:30:16 +00:00
e9d73c391e user_change_again (#29)
All checks were successful
Release Tagging / release (push) Successful in 36s
Rust Build / Check (pull_request) Successful in 29s
Rust Build / Test Suite (pull_request) Successful in 31s
Rust Build / Rustfmt (pull_request) Successful in 31s
Rust Build / Clippy (pull_request) Successful in 28s
Rust Build / build (pull_request) Successful in 28s
Rust Build / Check (push) Successful in 32s
Rust Build / Test Suite (push) Successful in 31s
Rust Build / Rustfmt (push) Successful in 28s
Rust Build / Clippy (push) Successful in 30s
Rust Build / build (push) Successful in 33s
Reviewed-on: #29
Co-authored-by: phoenix <kundeng94@gmail.com>
Co-committed-by: phoenix <kundeng94@gmail.com>
2025-04-05 16:58:52 +00:00
d476b128cb user_change (#28)
All checks were successful
Rust Build / Check (push) Successful in 34s
Rust Build / Test Suite (push) Successful in 30s
Rust Build / Rustfmt (push) Successful in 27s
Rust Build / Clippy (push) Successful in 28s
Rust Build / build (push) Successful in 31s
Release Tagging / release (push) Successful in 31s
Reviewed-on: #28
Co-authored-by: phoenix <kundeng94@gmail.com>
Co-committed-by: phoenix <kundeng94@gmail.com>
2025-04-05 16:25:57 +00:00
255aff414a user_and_salt (#27)
All checks were successful
Release Tagging / release (push) Successful in 31s
Rust Build / Check (push) Successful in 28s
Rust Build / Test Suite (push) Successful in 32s
Rust Build / Rustfmt (push) Successful in 32s
Rust Build / Clippy (push) Successful in 31s
Rust Build / build (push) Successful in 33s
Reviewed-on: #27
Co-authored-by: phoenix <kundeng94@gmail.com>
Co-committed-by: phoenix <kundeng94@gmail.com>
2025-04-05 15:39:44 +00:00
24aa60cb48 Merge pull request 'Next release' (#25) from devel into main
All checks were successful
Rust Build / Check (push) Successful in 28s
Rust Build / Test Suite (push) Successful in 35s
Rust Build / Rustfmt (push) Successful in 28s
Rust Build / Clippy (push) Successful in 31s
Rust Build / build (push) Successful in 30s
Release Tagging / release (push) Successful in 34s
Reviewed-on: #25
2025-04-04 04:08:03 +00:00
6a0135c6fa Id fix (#26)
All checks were successful
Release Tagging / release (push) Successful in 31s
Rust Build / Check (push) Successful in 28s
Rust Build / Test Suite (push) Successful in 29s
Rust Build / Rustfmt (push) Successful in 29s
Rust Build / Clippy (push) Successful in 28s
Rust Build / build (push) Successful in 27s
Rust Build / Check (pull_request) Successful in 42s
Rust Build / Test Suite (pull_request) Successful in 34s
Rust Build / Rustfmt (pull_request) Successful in 36s
Rust Build / Clippy (pull_request) Successful in 31s
Rust Build / build (pull_request) Successful in 34s
Reviewed-on: #26
Co-authored-by: phoenix <kundeng94@gmail.com>
Co-committed-by: phoenix <kundeng94@gmail.com>
2025-04-04 02:57:00 +00:00
8fbd92620e Added function to make coverart init easier (#24)
All checks were successful
Release Tagging / release (push) Successful in 32s
Rust Build / Check (push) Successful in 29s
Rust Build / Test Suite (push) Successful in 27s
Rust Build / Rustfmt (push) Successful in 26s
Rust Build / Clippy (push) Successful in 26s
Rust Build / build (push) Successful in 32s
Rust Build / Rustfmt (pull_request) Successful in 27s
Rust Build / Clippy (pull_request) Successful in 28s
Rust Build / build (pull_request) Successful in 28s
Rust Build / Check (pull_request) Successful in 31s
Rust Build / Test Suite (pull_request) Successful in 38s
Reviewed-on: #24
Co-authored-by: phoenix <kundeng94@gmail.com>
Co-committed-by: phoenix <kundeng94@gmail.com>
2025-04-04 02:21:31 +00:00
61ad88a258 First model change (#23)
All checks were successful
Release Tagging / release (push) Successful in 29s
Rust Build / Check (push) Successful in 26s
Rust Build / Test Suite (push) Successful in 26s
Rust Build / Rustfmt (push) Successful in 33s
Rust Build / Clippy (push) Successful in 30s
Rust Build / build (push) Successful in 28s
Reviewed-on: #23
Co-authored-by: phoenix <kundeng94@gmail.com>
Co-committed-by: phoenix <kundeng94@gmail.com>
2025-04-04 01:48:27 +00:00
d8eadb8187 Merge pull request 'v0.2.0 Release' (#20) from devel into main
Some checks failed
Rust Build / Check (push) Successful in 28s
Rust Build / Test Suite (push) Successful in 31s
Rust Build / Rustfmt (push) Successful in 31s
Rust Build / Clippy (push) Successful in 28s
Rust Build / build (push) Successful in 27s
Release Tagging / release (push) Failing after 34s
Reviewed-on: phoenix/icarus-models#20
2025-03-30 17:21:27 +00:00
KD
a64d35d153 Version bump (#22)
All checks were successful
Release Tagging / release (push) Successful in 31s
Rust Build / Check (pull_request) Successful in 27s
Rust Build / Clippy (pull_request) Successful in 31s
Rust Build / Check (push) Successful in 38s
Rust Build / Test Suite (push) Successful in 30s
Rust Build / Rustfmt (push) Successful in 26s
Rust Build / Clippy (push) Successful in 30s
Rust Build / build (push) Successful in 37s
Rust Build / Test Suite (pull_request) Successful in 28s
Rust Build / Rustfmt (pull_request) Successful in 30s
Rust Build / build (pull_request) Successful in 28s
v0.1.16

Reviewed-on: phoenix/icarus-models#22
Co-authored-by: KD <kundeng94@gmail.com>
Co-committed-by: KD <kundeng94@gmail.com>
2025-03-30 17:14:13 +00:00
f6fdb717e9 Merge pull request 'Changing project name' (#21) from name_change into devel
Some checks failed
Rust Build / Rustfmt (push) Successful in 28s
Rust Build / Clippy (push) Successful in 28s
Rust Build / Test Suite (pull_request) Successful in 29s
Rust Build / Rustfmt (pull_request) Successful in 27s
Rust Build / Check (push) Successful in 34s
Rust Build / Test Suite (push) Successful in 30s
Rust Build / build (push) Successful in 32s
Rust Build / Check (pull_request) Successful in 27s
Rust Build / Clippy (pull_request) Successful in 30s
Rust Build / build (pull_request) Successful in 32s
Release Tagging / release (push) Has been cancelled
Reviewed-on: phoenix/icarus-models#21
2025-03-30 16:55:14 +00:00
e5c1eabe8c Removed main branch from tag release workflow (#19)
Some checks failed
Rust Build / Rustfmt (pull_request) Successful in 27s
Rust Build / build (pull_request) Successful in 28s
Rust Build / Check (pull_request) Successful in 28s
Rust Build / Test Suite (pull_request) Successful in 32s
Rust Build / Clippy (pull_request) Successful in 28s
Release Tagging / release (push) Has been cancelled
Rust Build / Check (push) Waiting to run
Rust Build / Test Suite (push) Waiting to run
Rust Build / Rustfmt (push) Waiting to run
Rust Build / Clippy (push) Waiting to run
Rust Build / build (push) Waiting to run
Reviewed-on: phoenix/icarus-models#19
Co-authored-by: phoenix <kundeng94@gmail.com>
Co-committed-by: phoenix <kundeng94@gmail.com>
2025-03-30 16:53:17 +00:00
a8ffe80297 Changing project name
All checks were successful
Rust Build / Check (pull_request) Successful in 28s
Rust Build / Test Suite (pull_request) Successful in 30s
Rust Build / Rustfmt (pull_request) Successful in 28s
Rust Build / Clippy (pull_request) Successful in 33s
Rust Build / build (pull_request) Successful in 29s
Change name in the project settings and in other projects later
2025-03-29 19:35:02 -04:00
KD
56384fb371 Added file extension constant and updated constants module (#17)
All checks were successful
Rust Build / Check (push) Successful in 22s
Rust Build / Test Suite (push) Successful in 27s
Rust Build / Rustfmt (push) Successful in 23s
Rust Build / Clippy (push) Successful in 24s
Rust Build / build (push) Successful in 25s
Rust Build / Check (pull_request) Successful in 26s
Rust Build / Test Suite (pull_request) Successful in 28s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / Clippy (pull_request) Successful in 29s
Rust Build / build (pull_request) Successful in 30s
Release Tagging / release (push) Successful in 29s
Reviewed-on: phoenix/icarus-models#17
Co-authored-by: KD <kundeng94@gmail.com>
Co-committed-by: KD <kundeng94@gmail.com>
2025-03-29 22:37:02 +00:00
bf5808a06a Added default to coverart model (#18)
Some checks failed
Rust Build / Clippy (push) Waiting to run
Rust Build / build (push) Waiting to run
Rust Build / Check (push) Waiting to run
Rust Build / Test Suite (push) Waiting to run
Rust Build / Rustfmt (push) Waiting to run
Release Tagging / release (push) Failing after 32s
Reviewed-on: phoenix/icarus-models#18
Co-authored-by: phoenix <kundeng94@gmail.com>
Co-committed-by: phoenix <kundeng94@gmail.com>
2025-03-29 22:36:47 +00:00
2b2e96c02d Merge pull request 'devel' (#16) from devel into main
All checks were successful
Rust Build / Check (push) Successful in 26s
Rust Build / Test Suite (push) Successful in 26s
Rust Build / Rustfmt (push) Successful in 26s
Rust Build / Clippy (push) Successful in 26s
Rust Build / build (push) Successful in 26s
Release Tagging / release (push) Successful in 28s
Reviewed-on: phoenix/icarus-models#16
2025-03-22 21:24:15 +00:00
1c5c0ca70c Adding album tests (#13)
All checks were successful
Release Tagging / release (push) Successful in 28s
Rust Build / Check (push) Successful in 26s
Rust Build / Test Suite (push) Successful in 26s
Rust Build / Rustfmt (push) Successful in 26s
Rust Build / Clippy (push) Successful in 27s
Rust Build / build (push) Successful in 26s
Rust Build / Check (pull_request) Successful in 27s
Rust Build / Test Suite (pull_request) Successful in 27s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / Clippy (pull_request) Successful in 27s
Rust Build / build (pull_request) Successful in 25s
Reviewed-on: phoenix/icarus-models#13
Co-authored-by: phoenix <kundeng94@gmail.com>
Co-committed-by: phoenix <kundeng94@gmail.com>
2025-03-22 21:19:07 +00:00
bc3aace070 Added tests (#12)
All checks were successful
Release Tagging / release (push) Successful in 28s
Rust Build / Check (push) Successful in 27s
Rust Build / Test Suite (push) Successful in 33s
Rust Build / Rustfmt (push) Successful in 25s
Rust Build / Clippy (push) Successful in 28s
Rust Build / build (push) Successful in 25s
Rust Build / Check (pull_request) Successful in 26s
Rust Build / Test Suite (pull_request) Successful in 26s
Rust Build / Rustfmt (pull_request) Successful in 25s
Rust Build / Clippy (pull_request) Successful in 26s
Rust Build / build (pull_request) Successful in 25s
Reviewed-on: phoenix/icarus-models#12
Co-authored-by: phoenix <kundeng94@gmail.com>
Co-committed-by: phoenix <kundeng94@gmail.com>
2025-03-22 20:32:04 +00:00
ae2fd07229 Removing test (#14)
Some checks failed
Rust Build / Rustfmt (push) Waiting to run
Rust Build / Clippy (push) Waiting to run
Rust Build / build (push) Waiting to run
Release Tagging / release (push) Successful in 28s
Rust Build / Check (push) Successful in 26s
Rust Build / Test Suite (push) Has been cancelled
Reviewed-on: phoenix/icarus-models#14
Co-authored-by: phoenix <kundeng94@gmail.com>
Co-committed-by: phoenix <kundeng94@gmail.com>
2025-03-22 20:31:03 +00:00
e0617b3fb8 Workflow change (#15)
Some checks failed
Rust Build / Rustfmt (push) Waiting to run
Rust Build / Clippy (push) Waiting to run
Rust Build / build (push) Waiting to run
Release Tagging / release (push) Successful in 31s
Rust Build / Check (push) Successful in 25s
Rust Build / Test Suite (push) Has been cancelled
Reviewed-on: phoenix/icarus-models#15
Co-authored-by: phoenix <kundeng94@gmail.com>
Co-committed-by: phoenix <kundeng94@gmail.com>
2025-03-22 20:30:00 +00:00
KD
351147cb64 Fixed some warnings (#11)
All checks were successful
Release Tagging / release (push) Successful in 28s
Rust Build / Check (push) Successful in 25s
Rust Build / Test Suite (push) Successful in 26s
Rust Build / Rustfmt (push) Successful in 28s
Rust Build / Clippy (push) Successful in 29s
Rust Build / build (push) Successful in 26s
Rust Build / Check (pull_request) Successful in 26s
Rust Build / Test Suite (pull_request) Successful in 27s
Rust Build / Rustfmt (pull_request) Successful in 28s
Rust Build / Clippy (pull_request) Successful in 28s
Rust Build / build (pull_request) Successful in 27s
Reviewed-on: phoenix/icarus-models#11
Co-authored-by: KD <kundeng94@gmail.com>
Co-committed-by: KD <kundeng94@gmail.com>
2025-03-22 18:24:08 +00:00
d0e0d8fa2d Merge pull request 'Renamed branch' (#10) from updated_branch into devel
Some checks failed
Release Tagging / release (push) Successful in 28s
Rust Build / Check (push) Failing after 24s
Rust Build / Test Suite (push) Failing after 25s
Rust Build / Rustfmt (push) Successful in 25s
Rust Build / Clippy (push) Failing after 24s
Rust Build / build (push) Failing after 24s
Reviewed-on: phoenix/icarus-models#10
2025-03-22 01:25:02 +00:00
3f379cf454 Renamed branch
Some checks failed
Rust Build / Check (pull_request) Failing after 28s
Rust Build / Test Suite (pull_request) Failing after 26s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / Clippy (pull_request) Failing after 26s
Rust Build / build (pull_request) Failing after 25s
2025-03-21 21:21:53 -04:00
64f936bb3c Added workflow (#6)
Some checks failed
Release Tagging / release (push) Successful in 29s
Rust Build / Check (push) Failing after 26s
Rust Build / Test Suite (push) Failing after 29s
Rust Build / Rustfmt (push) Successful in 26s
Rust Build / Clippy (push) Failing after 26s
Rust Build / build (push) Failing after 26s
Reviewed-on: phoenix/icarus-models#6
Co-authored-by: phoenix <kundeng94@gmail.com>
Co-committed-by: phoenix <kundeng94@gmail.com>
2025-03-22 01:12:29 +00:00
929dac6413 Merge pull request 'Enabled tag release' (#9) from enable_release_tagging into main
All checks were successful
Release Tagging / release (push) Successful in 29s
Reviewed-on: phoenix/icarus-models#9
2025-03-22 01:10:45 +00:00
b91d543097 Enabled tag release 2025-03-21 21:10:02 -04:00
9307f80274 Merge pull request 'Addressing variable in steps' (#8) from stamp into main
All checks were successful
Release Tagging / release (push) Successful in 29s
Reviewed-on: phoenix/icarus-models#8
2025-03-22 01:06:39 +00:00
49c732ef1b Addressing variable in steps 2025-03-21 21:05:59 -04:00
5fe0c4ccb4 Merge pull request 'Added tag release workflow' (#7) from stamp into main
All checks were successful
Release Tagging / release (push) Successful in 27s
Reviewed-on: phoenix/icarus-models#7
2025-03-22 01:02:31 +00:00
7d24ce51cf Added tag release workflow 2025-03-21 21:01:31 -04:00
KD
474391ea44 Merge branch 'dev' into 'main'
v0.1.14

See merge request kdeng00/icarus-models!39
2025-03-21 13:13:28 +00:00
KD
abbb37721f Merge branch 'version_bump' into 'dev'
Version bump to v0.1.14

See merge request kdeng00/icarus-models!41
2025-03-21 00:38:08 +00:00
e366202f24 Version bump to v0.1.14 2025-03-20 20:34:59 -04:00
KD
950a70ccad Merge branch 'coverart' into 'dev'
Added coverart struct

See merge request kdeng00/icarus-models!40
2025-03-21 00:18:38 +00:00
KD
7f8649ee38 Added coverart struct 2025-03-21 00:18:38 +00:00
KD
ab3e519f53 Merge branch 'album_model' into 'dev'
Added Album collection

See merge request kdeng00/icarus-models!38
2025-03-19 00:56:18 +00:00
KD
98c518e149 Added Album collection 2025-03-19 00:56:17 +00:00
KD
9d3098de6b Merge branch 'song_changes' into 'dev'
Song changes

See merge request kdeng00/icarus-models!37
2025-03-19 00:45:56 +00:00
KD
04f1ffb1ce Song changes 2025-03-19 00:45:56 +00:00
KD
47f336d04d Merge branch 'warning-fix' into 'dev'
Making some changes to address warnings

See merge request kdeng00/icarus-models!36
2025-03-16 22:25:19 +00:00
e497ce11e0 Making some changes to address warnings
Constants changed
2025-03-16 15:15:31 -04:00
KD
fac33c7987 Merge branch 'dev' into 'main'
Dev

See merge request kdeng00/icarus-models!30
2025-03-15 21:38:00 +00:00
KD
7f5f546f65 Merge branch 'version_bump' into 'dev'
Updated version

See merge request kdeng00/icarus-models!35
2025-03-15 21:30:10 +00:00
KD
05537a4f6d Merge branch 'enhance_song_model' into 'dev'
Added functions

See merge request kdeng00/icarus-models!34
2025-03-15 21:26:54 +00:00
KD
64402a0626 Added functions 2025-03-15 21:26:54 +00:00
a84d59a5f5 Updated version 2025-03-15 17:25:55 -04:00
20 changed files with 1590 additions and 231 deletions

View File

@@ -0,0 +1,51 @@
name: Release Tagging
on:
pull_request:
branches:
- main
jobs:
release:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0 # Important for git describe --tags
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.90.0
components: cargo
- name: Extract Version from Cargo.toml
id: version
run: |
VERSION=$(grep '^version = "' Cargo.toml | sed -E 's/version = "([^"]+)"/\1/')
PROJECT_COMMIT_HASH=$(git rev-parse HEAD | cut -c 1-10)
BRANCH_REF="${GITHUB_REF}"
BRANCH_NAME=$(echo "$BRANCH_REF" | cut -d '/' -f 3)
PROJECT_TAG_RELEASE="v$VERSION-$BRANCH_NAME-$PROJECT_COMMIT_HASH"
echo "::set-output name=project_tag_release::$PROJECT_TAG_RELEASE-111"
echo "Version: $VERSION"
echo "Hash: $PROJECT_COMMIT_HASH"
echo "Branch: $BRANCH_NAME"
echo "Tag Release: $PROJECT_TAG_RELEASE"
- name: Print version
id: Version
run: |
echo "Printing version"
echo "Version: ${{ steps.version.outputs.project_tag_release }}"
- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.project_tag_release }}
release_name: Release ${{ steps.version.outputs.project_tag_release }}
body: |
Release of version ${{ steps.version.outputs.project_tag_release }}

View File

@@ -0,0 +1,64 @@
name: Rust Build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
check:
name: Check
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.90.0
- run: cargo check
test:
name: Test Suite
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.90.0
- run: cargo test
fmt:
name: Rustfmt
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.90.0
- run: rustup component add rustfmt
- run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.90.0
- run: rustup component add clippy
- run: cargo clippy -- -D warnings
build:
name: build
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.90.0
- run: cargo build

716
Cargo.lock generated Normal file
View File

@@ -0,0 +1,716 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "adler2"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
[[package]]
name = "aho-corasick"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
dependencies = [
"memchr",
]
[[package]]
name = "anyhow"
version = "1.0.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
[[package]]
name = "base64"
version = "0.22.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]]
name = "bitflags"
version = "2.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394"
[[package]]
name = "bumpalo"
version = "3.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43"
[[package]]
name = "cc"
version = "1.2.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac9fe6cdbb24b6ade63616c0a0688e45bb56732262c158df3c0c4bea4ca47cb7"
dependencies = [
"find-msvc-tools",
"shlex",
]
[[package]]
name = "cfg-if"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9"
[[package]]
name = "crc32fast"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511"
dependencies = [
"cfg-if",
]
[[package]]
name = "deranged"
version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a41953f86f8a05768a6cda24def994fd2f424b04ec5c719cf89989779f199071"
dependencies = [
"powerfmt",
"serde_core",
]
[[package]]
name = "equivalent"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
[[package]]
name = "errno"
version = "0.3.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
dependencies = [
"libc",
"windows-sys",
]
[[package]]
name = "fastrand"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
[[package]]
name = "find-msvc-tools"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127"
[[package]]
name = "flate2"
version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc5a4e564e38c699f2880d3fda590bedc2e69f3f84cd48b457bd892ce61d0aa9"
dependencies = [
"crc32fast",
"miniz_oxide",
]
[[package]]
name = "foreign-types"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
dependencies = [
"foreign-types-shared",
]
[[package]]
name = "foreign-types-shared"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
[[package]]
name = "getrandom"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4"
dependencies = [
"cfg-if",
"libc",
"r-efi",
"wasi",
]
[[package]]
name = "hashbrown"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d"
[[package]]
name = "icarus_models"
version = "0.7.0"
dependencies = [
"josekit",
"rand",
"serde",
"serde_json",
"tempfile",
"time",
"utoipa",
"uuid",
]
[[package]]
name = "indexmap"
version = "2.11.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5"
dependencies = [
"equivalent",
"hashbrown",
"serde",
"serde_core",
]
[[package]]
name = "itoa"
version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
[[package]]
name = "josekit"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a808e078330e6af222eb0044b71d4b1ff981bfef43e7bc8133a88234e0c86a0c"
dependencies = [
"anyhow",
"base64",
"flate2",
"openssl",
"regex",
"serde",
"serde_json",
"thiserror",
"time",
]
[[package]]
name = "js-sys"
version = "0.3.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec48937a97411dcb524a265206ccd4c90bb711fca92b2792c407f268825b9305"
dependencies = [
"once_cell",
"wasm-bindgen",
]
[[package]]
name = "libc"
version = "0.2.177"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976"
[[package]]
name = "linux-raw-sys"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039"
[[package]]
name = "log"
version = "0.4.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432"
[[package]]
name = "memchr"
version = "2.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
[[package]]
name = "miniz_oxide"
version = "0.8.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
dependencies = [
"adler2",
"simd-adler32",
]
[[package]]
name = "num-conv"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
[[package]]
name = "once_cell"
version = "1.21.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
[[package]]
name = "openssl"
version = "0.10.73"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8"
dependencies = [
"bitflags",
"cfg-if",
"foreign-types",
"libc",
"once_cell",
"openssl-macros",
"openssl-sys",
]
[[package]]
name = "openssl-macros"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "openssl-sys"
version = "0.9.109"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571"
dependencies = [
"cc",
"libc",
"pkg-config",
"vcpkg",
]
[[package]]
name = "pkg-config"
version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
[[package]]
name = "powerfmt"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
[[package]]
name = "ppv-lite86"
version = "0.2.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
dependencies = [
"zerocopy",
]
[[package]]
name = "proc-macro2"
version = "1.0.101"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1"
dependencies = [
"proc-macro2",
]
[[package]]
name = "r-efi"
version = "5.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
[[package]]
name = "rand"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
dependencies = [
"rand_chacha",
"rand_core",
]
[[package]]
name = "rand_chacha"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
dependencies = [
"ppv-lite86",
"rand_core",
]
[[package]]
name = "rand_core"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38"
dependencies = [
"getrandom",
]
[[package]]
name = "regex"
version = "1.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a52d8d02cacdb176ef4678de6c052efb4b3da14b78e4db683a4252762be5433"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata",
"regex-syntax",
]
[[package]]
name = "regex-automata"
version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "722166aa0d7438abbaa4d5cc2c649dac844e8c56d82fb3d33e9c34b5cd268fc6"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
]
[[package]]
name = "regex-syntax"
version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3160422bbd54dd5ecfdca71e5fd59b7b8fe2b1697ab2baf64f6d05dcc66d298"
[[package]]
name = "rustix"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e"
dependencies = [
"bitflags",
"errno",
"libc",
"linux-raw-sys",
"windows-sys",
]
[[package]]
name = "rustversion"
version = "1.0.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
[[package]]
name = "ryu"
version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
[[package]]
name = "serde"
version = "1.0.228"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
dependencies = [
"serde_core",
"serde_derive",
]
[[package]]
name = "serde_core"
version = "1.0.228"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.228"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "serde_json"
version = "1.0.145"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c"
dependencies = [
"indexmap",
"itoa",
"memchr",
"ryu",
"serde",
"serde_core",
]
[[package]]
name = "shlex"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
[[package]]
name = "simd-adler32"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe"
[[package]]
name = "syn"
version = "2.0.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "tempfile"
version = "3.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16"
dependencies = [
"fastrand",
"getrandom",
"once_cell",
"rustix",
"windows-sys",
]
[[package]]
name = "thiserror"
version = "2.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "2.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "time"
version = "0.3.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d"
dependencies = [
"deranged",
"itoa",
"num-conv",
"powerfmt",
"serde",
"time-core",
"time-macros",
]
[[package]]
name = "time-core"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b"
[[package]]
name = "time-macros"
version = "0.2.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3"
dependencies = [
"num-conv",
"time-core",
]
[[package]]
name = "unicode-ident"
version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d"
[[package]]
name = "utoipa"
version = "5.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fcc29c80c21c31608227e0912b2d7fddba57ad76b606890627ba8ee7964e993"
dependencies = [
"indexmap",
"serde",
"serde_json",
"utoipa-gen",
]
[[package]]
name = "utoipa-gen"
version = "5.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d79d08d92ab8af4c5e8a6da20c47ae3f61a0f1dabc1997cdf2d082b757ca08b"
dependencies = [
"proc-macro2",
"quote",
"syn",
"uuid",
]
[[package]]
name = "uuid"
version = "1.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2"
dependencies = [
"getrandom",
"js-sys",
"serde",
"wasm-bindgen",
]
[[package]]
name = "vcpkg"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
[[package]]
name = "wasi"
version = "0.14.7+wasi-0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c"
dependencies = [
"wasip2",
]
[[package]]
name = "wasip2"
version = "1.0.1+wasi-0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7"
dependencies = [
"wit-bindgen",
]
[[package]]
name = "wasm-bindgen"
version = "0.2.104"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1da10c01ae9f1ae40cbfac0bac3b1e724b320abfcf52229f80b547c0d250e2d"
dependencies = [
"cfg-if",
"once_cell",
"rustversion",
"wasm-bindgen-macro",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-backend"
version = "0.2.104"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "671c9a5a66f49d8a47345ab942e2cb93c7d1d0339065d4f8139c486121b43b19"
dependencies = [
"bumpalo",
"log",
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.104"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ca60477e4c59f5f2986c50191cd972e3a50d8a95603bc9434501cf156a9a119"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.104"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f07d2f20d4da7b26400c9f4a0511e6e0345b040694e8a75bd41d578fa4421d7"
dependencies = [
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.104"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bad67dc8b2a1a6e5448428adec4c3e84c43e561d8c9ee8a9e5aabeb193ec41d1"
dependencies = [
"unicode-ident",
]
[[package]]
name = "windows-link"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
[[package]]
name = "windows-sys"
version = "0.61.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
dependencies = [
"windows-link",
]
[[package]]
name = "wit-bindgen"
version = "0.46.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59"
[[package]]
name = "zerocopy"
version = "0.8.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c"
dependencies = [
"zerocopy-derive",
]
[[package]]
name = "zerocopy-derive"
version = "0.8.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831"
dependencies = [
"proc-macro2",
"quote",
"syn",
]

View File

@@ -1,10 +1,19 @@
[package]
name = "icarus-models"
version = "0.1.7"
name = "icarus_models"
version = "0.7.0"
edition = "2024"
rust-version = "1.90"
description = "models used for the icarus project"
license = "MIT"
[dependencies]
serde = { version = "1.0.218", features = ["derive"] }
serde_json = "1.0.139"
serde = { version = "1.0.228", features = ["derive"] }
serde_json = { version = "1.0.145" }
rand = { version = "0.9.2" }
time = { version = "0.3.44", features = ["formatting", "macros", "parsing", "serde"] }
uuid = { version = "1.18.1", features = ["v4", "serde"] }
josekit = { version = "0.10.3" }
utoipa = { version = "5.4.0", features = ["uuid", "time"] }
[dev-dependencies]
tempfile = { version = "3.23.0" }

View File

@@ -0,0 +1,2 @@
A library containing commonly used models and functions that is used throughout
icarus projects. This reduces the amount of duplicated code without a benefit.

View File

@@ -2,41 +2,41 @@ use std::default::Default;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Deserialize, Serialize, utoipa::ToSchema)]
pub struct AccessLevel {
pub id: i32,
pub id: uuid::Uuid,
pub level: String,
pub song_id: i32,
pub song_id: uuid::Uuid,
}
impl Default for AccessLevel {
fn default() -> Self {
AccessLevel {
id: -1,
id: uuid::Uuid::nil(),
level: String::new(),
song_id: -1,
song_id: uuid::Uuid::new_v4(),
}
}
}
pub fn default_level() -> AccessLevel {
return AccessLevel {
id: -1,
AccessLevel {
id: uuid::Uuid::nil(),
level: String::from("Public"),
song_id: -1,
};
song_id: uuid::Uuid::new_v4(),
}
}
pub fn private_level() -> AccessLevel {
return AccessLevel {
id: -1,
AccessLevel {
id: uuid::Uuid::new_v4(),
level: String::from("Private"),
song_id: -1,
};
song_id: uuid::Uuid::new_v4(),
}
}
impl AccessLevel {
pub fn _to_json(&self) -> Result<String, serde_json::Error> {
return serde_json::to_string_pretty(&self);
serde_json::to_string_pretty(&self)
}
}

43
src/album.rs Normal file
View File

@@ -0,0 +1,43 @@
pub mod collection {
use serde::{Deserialize, Serialize};
use std::default::Default;
use std::fs::File;
use std::io::BufReader;
use crate::init;
pub fn parse_album(filepath: &String) -> Result<Album, serde_json::Error> {
let file = File::open(filepath).expect("Failed to open file");
let reader = BufReader::new(file);
serde_json::from_reader(reader)
}
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct Album {
#[serde(skip_serializing_if = "String::is_empty")]
#[serde(alias = "album")]
pub title: String,
#[serde(skip_serializing_if = "String::is_empty")]
#[serde(alias = "album_artist")]
pub artist: String,
pub genre: String,
pub year: i32,
pub track_count: i32,
#[serde(skip_serializing_if = "init::is_set")]
pub disc_count: i32,
#[serde(skip_serializing_if = "Vec::is_empty")]
pub tracks: Vec<Track>,
}
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct Track {
pub title: String,
pub artist: String,
pub disc: i32,
pub track: i32,
// In seconds
pub duration: f64,
}
}

View File

@@ -1,5 +1,14 @@
pub const DEFAULT_MUSIC_EXTENSION: &str = FLAC_EXTENSION;
pub const FLAC_EXTENSION: &str = ".flac";
pub const WAV_EXTENSION: &str = ".wav";
pub const MPTHREE_EXTENSION: &str = ".mp3";
pub const JPG_EXTENSION: &str = ".jpg";
pub mod file_extensions {
pub mod audio {
pub const DEFAULTMUSICEXTENSION: &str = FLACEXTENSION;
pub const FLACEXTENSION: &str = ".flac";
pub const WAVEXTENSION: &str = ".wav";
pub const MPTHREEEXTENSION: &str = ".mp3";
}
pub mod image {
pub const JPGEXTENSION: &str = ".jpg";
pub const JPEGEXTENSION: &str = ".jpeg";
pub const PNGEXTENSION: &str = ".png";
}
}

84
src/coverart.rs Normal file
View File

@@ -0,0 +1,84 @@
use std::io::Write;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Default, Deserialize, Serialize, utoipa::ToSchema)]
pub struct CoverArt {
pub id: uuid::Uuid,
pub title: String,
#[serde(skip)]
pub path: String,
#[serde(skip)]
pub data: Vec<u8>,
pub song_id: uuid::Uuid,
}
pub mod init {
use crate::coverart::CoverArt;
pub fn init_coverart_only_path(path: String) -> CoverArt {
CoverArt {
id: uuid::Uuid::nil(),
title: String::new(),
path: path.clone(),
data: Vec::new(),
song_id: uuid::Uuid::nil(),
}
}
}
impl CoverArt {
/// Saves the coverart to the filesystem
pub fn save_to_filesystem(&self) -> Result<(), std::io::Error> {
match std::fs::File::create(&self.path) {
Ok(mut file) => match file.write_all(&self.data) {
Ok(_) => Ok(()),
Err(err) => Err(err),
},
Err(err) => Err(err),
}
}
/// Removes the coverart from the filesystem
pub fn remove_from_filesystem(&self) -> Result<(), std::io::Error> {
let p = std::path::Path::new(&self.path);
if p.exists() {
match std::fs::remove_file(p) {
Ok(_) => Ok(()),
Err(err) => Err(err),
}
} else {
Err(std::io::Error::other(
"Cannot delete file that does not exist",
))
}
}
}
pub mod io {
use std::io::Read;
/// Gets the raw data of the cover art
pub fn to_data(coverart: &super::CoverArt) -> Result<Vec<u8>, std::io::Error> {
let path: &String = &coverart.path;
let mut file = std::fs::File::open(path)?;
let mut buffer = Vec::new();
match file.read_to_end(&mut buffer) {
Ok(_) => Ok(buffer),
Err(err) => Err(err),
}
}
}
#[cfg(test)]
mod tests {
use crate::coverart;
#[test]
fn test_cover_art_image() {
let path: String = String::from("somepath");
let coverart = coverart::init::init_coverart_only_path(path.clone());
assert_eq!(path, coverart.path);
}
}

View File

@@ -1,22 +1,31 @@
pub mod access_level;
pub mod album;
pub mod constants;
pub mod coverart;
pub mod login_result;
pub mod song;
pub mod token;
pub mod types;
pub mod user;
pub fn add(left: u64, right: u64) -> u64 {
left + right
}
pub mod init {
pub fn is_id_valid(num: &i32) -> bool {
*num > 0
}
#[cfg(test)]
mod tests {
use super::*;
pub fn is_uuid_nil(uuid: &uuid::Uuid) -> bool {
uuid.is_nil()
}
#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
pub fn is_zero(num: &i32) -> bool {
*num == 0
}
pub fn is_dur_not_set(num: &i32) -> bool {
*num == 0
}
pub fn is_set(num: &i32) -> bool {
*num >= 0
}
}

View File

@@ -2,20 +2,20 @@ use std::default::Default;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Deserialize, Serialize, utoipa::ToSchema)]
pub struct LoginResult {
pub id: i32,
pub id: uuid::Uuid,
pub username: String,
pub token: String,
#[serde(alias = "token_type")]
pub token_type: String,
pub expiration: i32,
pub expiration: i64,
}
impl Default for LoginResult {
fn default() -> Self {
LoginResult {
id: -1,
id: uuid::Uuid::nil(),
username: String::new(),
token: String::new(),
token_type: String::new(),
@@ -26,6 +26,6 @@ impl Default for LoginResult {
impl LoginResult {
pub fn _to_json(&self) -> Result<String, serde_json::Error> {
return serde_json::to_string_pretty(&self);
serde_json::to_string_pretty(&self)
}
}

View File

@@ -1,13 +1,20 @@
use std::default::Default;
use std::io::Read;
use std::io::Write;
use rand::Rng;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Deserialize, Serialize)]
use crate::constants;
use crate::init;
use crate::types;
/// Length of characters of a filename to be generated
const FILENAME_LENGTH: i32 = 16;
#[derive(Clone, Debug, Default, Deserialize, Serialize, utoipa::ToSchema)]
pub struct Song {
#[serde(skip_serializing_if = "is_zero")]
#[serde(skip_serializing_if = "init::is_uuid_nil")]
#[serde(alias = "id")]
pub id: i32,
pub id: uuid::Uuid,
#[serde(skip_serializing_if = "String::is_empty")]
pub title: String,
#[serde(skip_serializing_if = "String::is_empty")]
@@ -18,17 +25,17 @@ pub struct Song {
pub album_artist: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub genre: String,
#[serde(skip_serializing_if = "is_zero")]
#[serde(skip_serializing_if = "init::is_zero")]
pub year: i32,
#[serde(skip_serializing_if = "is_dur_not_set")]
#[serde(skip_serializing_if = "init::is_dur_not_set")]
pub duration: i32,
#[serde(skip_serializing_if = "is_zero")]
#[serde(skip_serializing_if = "init::is_zero")]
pub track: i32,
#[serde(skip_serializing_if = "is_zero")]
#[serde(skip_serializing_if = "init::is_zero")]
pub disc: i32,
#[serde(skip_serializing_if = "is_zero")]
#[serde(skip_serializing_if = "init::is_zero")]
pub disc_count: i32,
#[serde(skip_serializing_if = "is_zero")]
#[serde(skip_serializing_if = "init::is_zero")]
pub track_count: i32,
#[serde(skip_serializing_if = "String::is_empty")]
pub audio_type: String,
@@ -36,178 +43,178 @@ pub struct Song {
pub date_created: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub filename: String,
#[serde(skip_serializing_if = "is_zero")]
pub user_id: i32,
#[serde(skip_serializing_if = "init::is_uuid_nil")]
pub user_id: uuid::Uuid,
#[serde(skip)]
pub data: Vec<u8>,
#[serde(skip)]
pub directory: String,
#[serde(skip)]
pub album_id: i32,
#[serde(skip)]
pub artist_id: i32,
#[serde(skip)]
pub genre_id: i32,
#[serde(skip)]
pub coverart_id: i32,
}
fn is_zero(num: &i32) -> bool {
*num == 0
}
fn is_dur_not_set(num: &i32) -> bool {
*num == 0
}
impl Default for Song {
fn default() -> Self {
Song {
id: 0,
title: String::new(),
artist: String::new(),
album: String::new(),
album_artist: String::new(),
genre: String::new(),
year: 0,
duration: 0,
track: 0,
disc: 0,
disc_count: 0,
track_count: 0,
audio_type: String::new(),
date_created: String::new(),
filename: String::new(),
user_id: 0,
data: Vec::new(),
directory: String::new(),
album_id: 0,
artist_id: 0,
genre_id: 0,
coverart_id: 0,
}
}
// TODO: Think about what to do with this
// #[serde(skip)]
// pub album_id: i32,
// #[serde(skip)]
// pub artist_id: i32,
// #[serde(skip)]
// pub genre_id: i32,
// #[serde(skip)]
// pub coverart_id: i32,
}
impl Song {
pub fn to_metadata_json(&self, pretty: bool) -> Result<String, serde_json::Error> {
if pretty {
return serde_json::to_string_pretty(&self);
serde_json::to_string_pretty(&self)
} else {
return serde_json::to_string(&self);
serde_json::to_string(&self)
}
}
// TODO: Implement
pub fn song_path(&self) -> String {
return String::new();
pub fn song_path(&self) -> Result<String, std::io::Error> {
if self.directory.is_empty() {
return Err(std::io::Error::other("Directory does not exist"));
}
pub fn to_data(&self) -> Result<Vec<u8>, std::io::Error> {
let path = self.song_path();
let directory = &self.directory;
let mut buffer: String = directory.clone();
let last_index = directory.len() - 1;
if let Some(character) = directory.chars().nth(last_index) {
if character != '/' {
buffer += "/";
}
buffer += &self.filename.clone();
Ok(buffer)
} else {
Err(std::io::Error::other(
"Could not access last character of directory",
))
}
}
/// Saves the song to the filesystem using the song's data
pub fn save_to_filesystem(&self) -> Result<(), std::io::Error> {
match self.song_path() {
Ok(song_path) => match std::fs::File::create(&song_path) {
Ok(mut file) => match file.write_all(&self.data) {
Ok(_res) => Ok(()),
Err(err) => Err(err),
},
Err(err) => Err(err),
},
Err(err) => Err(err),
}
}
/// Removes the song from the filesystem
pub fn remove_from_filesystem(&self) -> Result<(), std::io::Error> {
match self.song_path() {
Ok(song_path) => {
let p = std::path::Path::new(&song_path);
if p.exists() {
match std::fs::remove_file(p) {
Ok(_) => Ok(()),
Err(err) => Err(err),
}
} else {
Err(std::io::Error::other(
"Cannot delete file that does not exist",
))
}
}
Err(err) => Err(err),
}
}
}
/// Generates a filename. In order to save a song to the filesystem, the song must have
/// a directory and filename
pub fn generate_filename(typ: types::MusicTypes, randomize: bool) -> String {
let file_extension = match typ {
types::MusicTypes::DefaultMusicExtension => {
String::from(constants::file_extensions::audio::DEFAULTMUSICEXTENSION)
}
types::MusicTypes::WavExtension => {
String::from(constants::file_extensions::audio::WAVEXTENSION)
}
types::MusicTypes::FlacExtension => {
String::from(constants::file_extensions::audio::FLACEXTENSION)
}
types::MusicTypes::MPThreeExtension => {
String::from(constants::file_extensions::audio::MPTHREEEXTENSION)
}
};
if randomize {
let mut filename: String = String::new();
let some_chars: String = String::from("abcdefghij0123456789");
let mut rng = rand::rng();
for _ in 0..FILENAME_LENGTH {
let index = rng.random_range(0..=19);
let rando_char = some_chars.chars().nth(index);
if let Some(c) = rando_char {
filename.push(c);
}
}
filename + &file_extension
} else {
"track-output".to_string() + &file_extension
}
}
/// I/O operations for songs
pub mod io {
use std::io::Read;
/// Copies a song using the source song's data
pub fn copy_song(
song_source: &super::Song,
song_target: &mut super::Song,
) -> Result<(), std::io::Error> {
match song_target.song_path() {
Ok(songpath) => {
let p = std::path::Path::new(&songpath);
if p.exists() {
Err(std::io::Error::other(
"Cannot copy song over to one that already exists",
))
} else {
if song_target.data.is_empty() {
song_target.data = song_source.data.clone();
} else {
song_target.data.clear();
song_target.data = song_source.data.clone();
}
match song_target.save_to_filesystem() {
Ok(_) => Ok(()),
Err(err) => Err(err),
}
}
}
Err(err) => Err(err),
}
}
/// Gets the raw file data of a song from the filesystem
pub fn to_data(song: &super::Song) -> Result<Vec<u8>, std::io::Error> {
match song.song_path() {
Ok(path) => {
let mut file = std::fs::File::open(path)?;
let mut buffer: Vec<u8> = Vec::new();
file.read_to_end(&mut buffer)?;
if buffer.len() == 0 {
Err(std::io::Error::new(
std::io::ErrorKind::Other,
"File is empty",
))
if buffer.is_empty() {
Err(std::io::Error::other("File is empty"))
} else {
Ok(buffer)
}
}
}
mod embedded {
use serde::{Deserialize, Serialize};
// The song's duration is a floating point in seconds
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Song {
#[serde(skip_serializing_if = "is_embed_zero")]
#[serde(alias = "id")]
pub id: i32,
#[serde(skip_serializing_if = "String::is_empty")]
pub title: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub artist: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub album: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub album_artist: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub genre: String,
#[serde(skip_serializing_if = "is_embed_zero")]
pub year: i32,
#[serde(skip_serializing_if = "is_embed_dur_not_set")]
pub duration: f64,
#[serde(skip_serializing_if = "is_embed_zero")]
pub track: i32,
#[serde(skip_serializing_if = "is_embed_zero")]
pub disc: i32,
#[serde(skip_serializing_if = "is_embed_zero")]
pub disc_count: i32,
#[serde(skip_serializing_if = "is_embed_zero")]
pub track_count: i32,
#[serde(skip_serializing_if = "String::is_empty")]
pub audio_type: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub date_created: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub filename: String,
#[serde(skip_serializing_if = "is_embed_zero")]
pub user_id: i32,
#[serde(skip)]
pub data: Vec<u8>,
#[serde(skip)]
pub directory: String,
#[serde(skip)]
pub album_id: i32,
#[serde(skip)]
pub artist_id: i32,
#[serde(skip)]
pub genre_id: i32,
#[serde(skip)]
pub coverart_id: i32,
}
fn is_embed_zero(num: &i32) -> bool {
*num == 0
}
fn is_embed_dur_not_set(num: &f64) -> bool {
*num == 0.0
}
impl Default for Song {
fn default() -> Self {
Song {
id: 0,
title: String::new(),
artist: String::new(),
album: String::new(),
album_artist: String::new(),
genre: String::new(),
year: 0,
duration: 0.0,
track: 0,
disc: 0,
disc_count: 0,
track_count: 0,
audio_type: String::new(),
date_created: String::new(),
filename: String::new(),
user_id: 0,
data: Vec::new(),
directory: String::new(),
album_id: 0,
artist_id: 0,
genre_id: 0,
coverart_id: 0,
}
Err(er) => Err(er),
}
}
}

View File

@@ -5,16 +5,16 @@ use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Token {
pub scope: String,
pub expiration: i32,
pub expiration: i64,
pub audience: String,
pub issuer: String,
pub issued: i32,
pub issued: i64,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct AccessToken {
#[serde(alias = "user_id")]
pub user_id: i32,
#[serde(alias = "init::is_uuid_nil")]
pub user_id: uuid::Uuid,
#[serde(alias = "username")]
pub username: String,
#[serde(alias = "token")]
@@ -22,7 +22,7 @@ pub struct AccessToken {
#[serde(alias = "token_type")]
pub token_type: String,
#[serde(alias = "expiration")]
pub expiration: i32,
pub expiration: i64,
#[serde(alias = "message")]
pub message: String,
}
@@ -43,22 +43,159 @@ impl AccessToken {
pub fn bearer_token(&self) -> String {
let mut token: String = String::from("Bearer ");
token += &self.token.clone();
return token;
token
}
}
impl Token {
pub fn _to_json(&self) -> Result<String, serde_json::Error> {
return serde_json::to_string_pretty(&self);
serde_json::to_string_pretty(&self)
}
// TODO: Implement
pub fn token_expired(&self) -> bool {
return false;
false
}
// TODO: Implement
pub fn contains_scope(&self, des_scope: String) -> bool {
return false;
pub fn contains_scope(&self, des_scope: &String) -> bool {
self.scope.contains(des_scope)
}
}
pub fn get_issued() -> time::Result<time::OffsetDateTime> {
Ok(time::OffsetDateTime::now_utc())
}
mod util {
pub fn time_to_std_time(
provided_time: &time::OffsetDateTime,
) -> Result<std::time::SystemTime, std::time::SystemTimeError> {
let converted = std::time::SystemTime::from(*provided_time);
Ok(converted)
}
}
#[derive(Debug)]
pub struct TokenResource {
pub message: String,
pub issuer: String,
pub audiences: Vec<String>,
pub id: uuid::Uuid,
}
pub const TOKEN_TYPE: &str = "JWT";
pub fn create_token(
key: &String,
token_resource: &TokenResource,
duration: time::Duration,
) -> Result<(String, i64), josekit::JoseError> {
let mut header = josekit::jws::JwsHeader::new();
header.set_token_type(TOKEN_TYPE);
let mut payload = josekit::jwt::JwtPayload::new();
let message = &token_resource.message;
let issuer = &token_resource.issuer;
let audiences: &Vec<String> = &token_resource.audiences;
payload.set_subject(message);
payload.set_issuer(issuer);
payload.set_audience(audiences.clone());
if !token_resource.id.is_nil() {
match payload.set_claim("id", Some(serde_json::json!(token_resource.id))) {
Ok(_) => {}
Err(err) => {
return Err(err);
}
}
}
match get_issued() {
Ok(issued) => {
let expire = issued + duration;
payload.set_issued_at(&util::time_to_std_time(&issued).unwrap());
payload.set_expires_at(&util::time_to_std_time(&expire).unwrap());
let signer = josekit::jws::alg::hmac::HmacJwsAlgorithm::Hs256
.signer_from_bytes(key.as_bytes())
.unwrap();
Ok((
josekit::jwt::encode_with_signer(&payload, &header, &signer).unwrap(),
(expire - time::OffsetDateTime::UNIX_EPOCH).whole_seconds(),
))
}
Err(e) => Err(josekit::JoseError::InvalidClaim(e.into())),
}
}
#[cfg(test)]
mod tests {
use super::*;
fn test_key() -> String {
String::from("c3092urmc2219ix320i40m293ic29IM09IN0u879Y8B98YB8yb86TN7B55R4yv4RCVU6Bi8YO8U")
}
fn test_resource() -> TokenResource {
TokenResource {
issuer: String::from("icarus_auth_test"),
message: String::from("Authorization"),
audiences: vec![String::from("icarus_test")],
id: uuid::Uuid::nil(),
}
}
#[test]
fn test_token_scope_check() {
let mut token = Token::default();
token.scope = String::from("song:read song:upload song:download");
let check_scope = String::from("song:download");
let result = token.contains_scope(&check_scope);
assert!(
result,
"Error: The scope {:?} was not found in the token's scope {:?}",
check_scope, token.scope
);
}
#[test]
fn test_token_creation() {
let key = test_key();
let test_token_resource = test_resource();
let token_expiration_duration = time::Duration::hours(2);
match create_token(&key, &test_token_resource, token_expiration_duration) {
Ok((token, expire_duration)) => {
assert_eq!(false, token.is_empty(), "Error: Token is empty");
assert!(
expire_duration > 0,
"Token expire duration is invalid {expire_duration:?}"
);
}
Err(err) => {
assert!(false, "Error: {err:?}");
}
}
}
#[test]
fn test_token_creation_with_id() {
let key = test_key();
let mut test_token_resource = test_resource();
test_token_resource.id = uuid::Uuid::new_v4();
let token_expiration_duration = time::Duration::hours(2);
match create_token(&key, &test_token_resource, token_expiration_duration) {
Ok((token, expire_duration)) => {
assert_eq!(false, token.is_empty(), "Error: Token is empty");
assert!(
expire_duration > 0,
"Token expire duration is invalid {expire_duration:?}"
);
}
Err(err) => {
assert!(false, "Error: {err:?}");
}
}
}
}

View File

@@ -1,9 +1,6 @@
use std::default::Default;
mod types {
pub enum Types {
WAV_EXTENSION,
FLAC_EXTENSION,
MP_EXTENSION,
}
pub enum MusicTypes {
DefaultMusicExtension,
WavExtension,
FlacExtension,
MPThreeExtension,
}

View File

@@ -1,11 +1,13 @@
use std::default::Default;
use crate::init;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Deserialize, Serialize, utoipa::ToSchema)]
pub struct User {
#[serde(skip_serializing_if = "is_id_valid")]
pub id: i32,
#[serde(skip_serializing_if = "init::is_uuid_nil")]
pub id: uuid::Uuid,
#[serde(skip_serializing_if = "String::is_empty")]
pub username: String,
#[serde(skip_serializing_if = "String::is_empty")]
@@ -19,22 +21,20 @@ pub struct User {
#[serde(skip_serializing_if = "String::is_empty")]
pub lastname: String,
pub email_verified: bool,
#[serde(skip_serializing_if = "String::is_empty")]
pub date_created: String,
#[serde(with = "time::serde::rfc3339::option")]
pub date_created: Option<time::OffsetDateTime>,
#[serde(skip_serializing_if = "String::is_empty")]
pub status: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub last_login: String,
}
fn is_id_valid(num: &i32) -> bool {
*num > 0
#[serde(with = "time::serde::rfc3339::option")]
pub last_login: Option<time::OffsetDateTime>,
#[serde(skip_serializing_if = "init::is_uuid_nil")]
pub salt_id: uuid::Uuid,
}
impl Default for User {
fn default() -> Self {
User {
id: -1,
id: uuid::Uuid::new_v4(),
username: String::new(),
password: String::new(),
email: String::new(),
@@ -42,9 +42,10 @@ impl Default for User {
firstname: String::new(),
lastname: String::new(),
email_verified: false,
date_created: String::new(),
date_created: None,
status: String::new(),
last_login: String::new(),
last_login: None,
salt_id: uuid::Uuid::nil(),
}
}
}
@@ -52,9 +53,35 @@ impl Default for User {
impl User {
pub fn to_json(&self, output_pretty: bool) -> Result<String, serde_json::Error> {
if output_pretty {
return serde_json::to_string_pretty(&self);
serde_json::to_string_pretty(&self)
} else {
return serde_json::to_string(&self);
serde_json::to_string(&self)
}
}
}
pub mod salt {
use std::default::Default;
use crate::init;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct Salt {
#[serde(skip_serializing_if = "init::is_uuid_nil")]
pub id: uuid::Uuid,
#[serde(skip_serializing_if = "String::is_empty")]
pub salt: String,
}
impl Salt {
pub fn to_json(&self, output_pretty: bool) -> Result<String, serde_json::Error> {
if output_pretty {
serde_json::to_string_pretty(&self)
} else {
serde_json::to_string(&self)
}
}
}
}

31
tests/album.json Normal file
View File

@@ -0,0 +1,31 @@
{
"album": "Sample Tracks! Yes",
"album_artist": "KD",
"genre": "Country",
"year": 2025,
"track_count": 3,
"disc_count": 1,
"tracks": [
{
"title": "E less",
"artist": "KD",
"disc": 1,
"track": 1,
"duration": 31
},
{
"title": "Aaaaaye",
"artist": "KD",
"disc": 1,
"track": 2,
"duration": 33
},
{
"title": "Check D out",
"artist": "KD",
"disc": 1,
"track": 3,
"duration": 22
}
]
}

173
tests/tests.rs Normal file
View File

@@ -0,0 +1,173 @@
mod utils {
use std::fs;
use std::io::Read;
use std::path::Path;
pub fn get_tests_directory() -> String {
String::from(env!("CARGO_MANIFEST_DIR").to_owned() + "/tests/")
}
pub fn does_directory_exists(directory: &String) -> bool {
let path = Path::new(directory);
if let Ok(dir_i) = fs::metadata(path) {
dir_i.is_dir()
} else {
false
}
}
pub fn extract_data_from_file(filepath: &String) -> Result<Vec<u8>, std::io::Error> {
match std::fs::File::open(filepath) {
Ok(mut file) => {
let mut buffer: Vec<u8> = Vec::new();
let _ = file.read_to_end(&mut buffer);
Ok(buffer)
}
Err(err) => Err(err),
}
}
}
#[cfg(test)]
mod song_tests {
use tempfile::tempdir;
use crate::utils;
use icarus_models::song;
use icarus_models::types;
#[test]
fn test_song_to_data() {
println!("Test");
let some_val = true;
println!("Checking if some_val is true");
assert_eq!(true, some_val);
println!("Getting track");
let mut song = song::Song::default();
song.directory = utils::get_tests_directory();
song.filename = String::from("track01.flac");
assert!(
utils::does_directory_exists(&song.directory),
"Directory does not exist"
);
println!("Directory: {}", song.directory);
match song.song_path() {
Ok(filepath) => match utils::extract_data_from_file(&filepath) {
Ok(buffer) => {
assert_eq!(buffer.is_empty(), false);
match song::io::to_data(&song) {
Ok(song_data) => {
println!("Both files match");
assert_eq!(buffer, song_data);
}
Err(err) => {
assert!(false, "Error producing song data: {:?}", err);
}
};
}
Err(err) => {
assert!(false, "Failed to open file: {:?}", err);
}
},
Err(err) => {
assert!(false, "Could not get song path: {:?}", err);
}
}
}
#[test]
fn test_song_path_check() {
let mut song = song::Song::default();
song.directory = utils::get_tests_directory();
song.filename = String::from("track01.flac");
assert!(
utils::does_directory_exists(&song.directory),
"Directory does not exist"
);
}
#[test]
fn test_song_generate_filename() {
let mut song = song::Song::default();
song.directory = utils::get_tests_directory();
song.filename = String::from("track01.flac");
let mut song_cpy = song.clone();
let temp_dir = tempdir().expect("Failed to create temp dir");
song_cpy.directory = match temp_dir.path().to_str() {
Some(s) => String::from(s),
None => String::new(),
};
assert_eq!(song.directory.is_empty(), false);
song_cpy.filename = song::generate_filename(types::MusicTypes::FlacExtension, true);
println!("Directory: {:?}", song_cpy.directory);
println!("File to be created: {:?}", song_cpy.filename);
match song::io::copy_song(&song, &mut song_cpy) {
Ok(_) => {}
Err(err) => {
assert!(false, "Error copying song: Error: {err:?}")
}
}
}
#[test]
fn test_save_song_to_filesystem_and_remove() {
let mut song = song::Song::default();
song.directory = utils::get_tests_directory();
song.filename = String::from("track02.flac");
let mut copied_song = song::Song {
directory: utils::get_tests_directory(),
filename: String::from("track02-coppied.flac"),
..Default::default()
};
match song::io::copy_song(&song, &mut copied_song) {
Ok(_) => match copied_song.remove_from_filesystem() {
Ok(_) => {}
Err(err) => {
assert!(false, "Error: {err:?}")
}
},
Err(err) => {
assert!(false, "Error: {err:?}")
}
}
}
}
#[cfg(test)]
mod album_tests {
use crate::utils;
use icarus_models::album;
#[test]
fn parse_album() {
let test_dir = utils::get_tests_directory();
if utils::does_directory_exists(&test_dir) {
let album_file: String = test_dir + &String::from("album.json");
println!("Album file: {:?}", album_file);
match album::collection::parse_album(&album_file) {
Ok(album) => {
println!("Album title: {}", album.title);
assert_eq!(album.title.is_empty(), false);
assert_eq!(album.artist.is_empty(), false);
assert_eq!(album.tracks.is_empty(), false);
}
Err(err) => {
assert!(false, "Error parsing album json file: {:?}", err);
}
}
}
}
}

BIN
tests/track01.flac Normal file

Binary file not shown.

BIN
tests/track02.flac Normal file

Binary file not shown.

BIN
tests/track03.flac Normal file

Binary file not shown.