mirror of
https://github.com/chrisbenincasa/tunarr.git
synced 2026-04-18 09:03:35 -04:00
fix: multiple fixes to NFO parsing to be more permissive
This commit is contained in:
@@ -14,7 +14,13 @@ describe('MovieNfoParser', () => {
|
||||
expect(output.movie.credits).length(2);
|
||||
expect(output.movie.director).length(1);
|
||||
expect(output.movie.actor).length(5);
|
||||
});
|
||||
|
||||
console.log(output);
|
||||
test('parses NFOs without explicit fileinfo', async () => {
|
||||
const contents = (await readTestFile('nfo-without-fileinfo.nfo')).toString(
|
||||
'utf-8',
|
||||
);
|
||||
const result = await new MovieNfoParser().parse(contents);
|
||||
expect(result.isSuccess()).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -11,6 +11,7 @@ const ArrayTags = [
|
||||
'movie.tag',
|
||||
'movie.fileinfo',
|
||||
'movie.actor',
|
||||
'movie.uniqueid',
|
||||
];
|
||||
|
||||
export class MovieNfoParser extends BaseNfoParser<typeof MovieNfoContainer> {
|
||||
|
||||
@@ -33,10 +33,10 @@ export const NfoAudioStream = z.object({
|
||||
});
|
||||
|
||||
export const NfoVideoStream = z.object({
|
||||
codec: z.string(),
|
||||
codec: z.string().optional(),
|
||||
aspect: z.coerce.number().or(z.string()).optional(),
|
||||
width: z.coerce.number(),
|
||||
height: z.coerce.number(),
|
||||
width: z.coerce.number().optional(),
|
||||
height: z.coerce.number().optional(),
|
||||
durationinseconds: z.coerce.number().optional(),
|
||||
stereomode: z.string().optional(),
|
||||
hdrtype: z.enum(['', 'hdr10', 'dolbyvision', 'hlg']).nullish().catch(''),
|
||||
@@ -48,7 +48,7 @@ export const NfoSubtitleStream = z.object({
|
||||
|
||||
export const NfoFileInfo = z.object({
|
||||
streamdetails: z.object({
|
||||
video: NfoVideoStream,
|
||||
video: NfoVideoStream.optional(),
|
||||
audio: z.array(NfoAudioStream).or(NfoAudioStream).optional(),
|
||||
subtitle: z.array(NfoSubtitleStream).or(NfoSubtitleStream).optional(),
|
||||
}),
|
||||
|
||||
64
server/src/testing/resources/nfo-without-fileinfo.nfo
Normal file
64
server/src/testing/resources/nfo-without-fileinfo.nfo
Normal file
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<movie>
|
||||
<title>NBC Saturday Morning Cartoons | 1989 | Full Episodes with Commercials</title>
|
||||
<plot>Shh! Don't tell anyone, but you're invited to NBC's Secret Saturday Club. Dig into a big bowl of cereal with Papa Smurf, ALF, John Candy, Kissyfur, and the rest as we christen the weekend with classic Saturday morning cartoons.
|
||||
|
||||
This is a compilation video I put together using footage of commercials and episodes from shows that played on Saturday mornings (from 8 in the morning to one in the afternoon) on NBC in the year 1989. It follows a fall 1989 schedule for NBC Saturday mornings, particularly its September 9th, 1989 schedule where the new fall shows debuted. The show Saved by the Bell can't be used for copyright reasons. This show was substituted with another great show that played on NBC around the same time. Think of it as a retro remix or a bootleg Saturday morning broadcast.
|
||||
|
||||
Another oneof Rinse Repeat’s archives! He definitelyhad some classics when it comes to channels or blocks so i thought…why not do some NBC! I hope you enjoy this blast from the past!
|
||||
|
||||
Disclaimer: I do not make any money or accept any donations for these videos. I make them in my free time as a hobby, out of a love for old television, and because they're the kinds of videos I would like to be able to watch on Youtube. If you see Youtube ads (not commercials) on this video, that's because this video was copyright claimed by a variety of different companies, who chose to run ads on my video for their own profit. I also do not make these videos for children, but for adults like myself who are nostalgic for their childhoods. If the comments are disabled on this video or another like it, it's because Youtube set it as "for children." And that's the end of that disclaimer.
|
||||
|
||||
|
||||
⏪ TV GUIDE ⏪
|
||||
00:00:00 Intro
|
||||
00:00:10 Who Shrunk Saturday Morning?
|
||||
00:30:10 Camp Candy
|
||||
01:00:10 Captain N: The Game Master
|
||||
01:30:10 The Karate Kid
|
||||
02:00:10 The Smurfs
|
||||
02:30:10 The Smurfs
|
||||
03:00:10 The Chipmunks
|
||||
03:30:10 Kissyfur
|
||||
04:00:10 ALF: The Animated Series
|
||||
04:30:10 ALF Tales
|
||||
|
||||
📺 EPISODE GUIDE 📺
|
||||
Who Shrunk Saturday Morning?
|
||||
Camp Candy - S01E01 - The Forest's Prime Evil
|
||||
Captain N: The Game Master - S01E01 - Kevin in Videoland
|
||||
The Karate Kid - S01E01 - My Brother's Keeper
|
||||
The Smurfs - S09E01 - The Smurfs That Time Forgot
|
||||
The Smurfs - S09E02 - Cave Smurfs / Lost in the Ages
|
||||
The Chipmunks - S07E02 - Home Sweet Home / All Worked Up
|
||||
Kissyfur - S02E01 - The Great Swamp Swami / The Shell Game
|
||||
ALF: The Animated Series - S02E01 - Flodust Memories
|
||||
ALF Tales - S02E01 - Hansel & Gretel</plot>
|
||||
|
||||
<!-- IDs -->
|
||||
<uniqueid type="youtube" default="true">nXTl-lKru78</uniqueid>
|
||||
<youtubeid>nXTl-lKru78</youtubeid>
|
||||
|
||||
<!-- Dates -->
|
||||
<premiered>2025-08-16</premiered>
|
||||
|
||||
<!-- People / orgs -->
|
||||
<studio>Childhood Network</studio>
|
||||
<credits>Childhood Network</credits>
|
||||
|
||||
<!-- Classification -->
|
||||
<genre>Entertainment</genre>
|
||||
|
||||
<!-- Runtime -->
|
||||
<runtime>301</runtime>
|
||||
<fileinfo>
|
||||
<streamdetails>
|
||||
<video>
|
||||
<durationinseconds>18015</durationinseconds>
|
||||
</video>
|
||||
</streamdetails>
|
||||
</fileinfo>
|
||||
|
||||
<!-- Backlink to YouTube in Kodi format -->
|
||||
<trailer>plugin://plugin.video.youtube/?action=play_video&videoid=nXTl-lKru78</trailer>
|
||||
</movie>
|
||||
Reference in New Issue
Block a user