Skip to content

Commit

Permalink
Add MAR format support
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalecot committed Jan 23, 2024
1 parent c44efd8 commit 122e3f9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ identification.
- Extensible Archive (XAR)
- LArc (LZS)
- LHA
- Mozilla Archive (MAR)
- PMarc (PMA)
- Roshal Archive (RAR)
- SeqBox (SBX)
Expand Down
Binary file added fixtures/archive/sample.mar
Binary file not shown.
7 changes: 7 additions & 0 deletions src/formats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1505,6 +1505,13 @@ formats! {
extension = "ape"
kind = Audio

format = MozillaArchive
name = "Mozilla Archive"
short_name = "MAR"
media_type = "application/x-mozilla-archive"
extension = "mar"
kind = Archive

format = Mp3Url
name = "MP3 URL"
short_name = "M3U"
Expand Down
3 changes: 3 additions & 0 deletions src/signatures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1134,6 +1134,9 @@ signatures! {
format = MonkeysAudio
value = b"MAC "

format = MozillaArchive
value = b"MAR1"

format = Mpeg12Video
value = b"\x00\x00\x01\xB3"
value = b"\x00\x00\x01\xBA"
Expand Down
6 changes: 6 additions & 0 deletions tests/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ fn test_lha() {
assert_eq!(fmt, FileFormat::Lha);
}

#[test]
fn test_mozilla_archive() {
let fmt = FileFormat::from_file("fixtures/archive/sample.mar").unwrap();
assert_eq!(fmt, FileFormat::MozillaArchive);
}

#[test]
fn test_pmarc() {
let fmt = FileFormat::from_file("fixtures/archive/sample.pma").unwrap();
Expand Down

0 comments on commit 122e3f9

Please sign in to comment.