Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cfcb221
commit 672b952
Showing
43 changed files
with
447 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import "dotenv/config"; | ||
import matter from "gray-matter"; | ||
import { bold, gray } from "kleur/colors"; | ||
import fs from "node:fs"; | ||
import path from "node:path"; | ||
import sharp from "sharp"; | ||
import { Logger, getContentDirs } from "./catalogueUtils"; | ||
|
||
export interface MovieData { | ||
id: string; | ||
title: string; | ||
image: string; | ||
year: string; | ||
plot: string; | ||
releaseDate: string; | ||
companyList: { id: string; name: string }[]; | ||
genreList: { key: string; value: string }[]; | ||
runtimeStr: string; | ||
} | ||
|
||
export async function getDataForMoviesAndShows(type: "movies" | "shows") { | ||
const apiKey = process.env.IMDB_KEY; | ||
const moviesShowsDirs = getContentDirs(type); | ||
|
||
for (const movieShowDir of moviesShowsDirs) { | ||
const dirBasename = path.basename(movieShowDir.pathname); | ||
const dataFilePath = new URL("./_data.json", movieShowDir); | ||
|
||
Logger.info(`Getting data for ${type}/${bold(dirBasename)}...`); | ||
if (fs.existsSync(dataFilePath)) { | ||
Logger.info(gray(`Data already exists, skipping...`)); | ||
continue; | ||
} | ||
|
||
const markdownContent = fs | ||
.readFileSync(new URL(path.basename(movieShowDir.pathname) + ".md", movieShowDir)) | ||
.toString(); | ||
const movieId = matter(markdownContent).data.imdb; | ||
const response = (await fetch( | ||
`https://imdb-api.com/en/API/Title/${apiKey}/${movieId}/Posters`, | ||
).then((response) => response.json())) as MovieData; | ||
const { image } = response; | ||
const resultData = { | ||
title: response.title, | ||
id: response.id, | ||
plot: response.plot, | ||
releaseDate: response.releaseDate, | ||
runtimeStr: response.runtimeStr, | ||
year: response.year, | ||
companies: response.companyList.map((company) => company.name), | ||
genres: response.genreList.map((genre) => genre.value), | ||
}; | ||
|
||
fs.writeFileSync(dataFilePath, JSON.stringify(resultData, null, 2)); | ||
Logger.success(`Data saved for ${bold(dirBasename)}!`); | ||
|
||
const coverURL = image; | ||
const coverData = await fetch(coverURL).then((response) => response.arrayBuffer()); | ||
const coverPath = new URL("./cover.png", movieShowDir); | ||
if (!coverURL.endsWith("png")) { | ||
sharp(coverData).toFile(coverPath.pathname); | ||
} else { | ||
fs.writeFileSync(coverPath, Buffer.from(coverData)); | ||
} | ||
|
||
fs.writeFileSync(coverPath, Buffer.from(coverData)); | ||
Logger.success(`Cover saved for ${bold(dirBasename)}!`); | ||
} | ||
|
||
return moviesShowsDirs.length; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"title": "Call Me by Your Name", | ||
"id": "tt5726616", | ||
"plot": "In 1980s Italy, romance blossoms between a seventeen-year-old student and the older man hired as his father's research assistant.", | ||
"releaseDate": "2018-01-19", | ||
"runtimeStr": "2h 12min", | ||
"year": "2017", | ||
"companies": ["Frenesy Film Company", "La Cinéfacture", "RT Features"], | ||
"genres": ["Drama", "Romance"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: Call Me By Your Name | ||
rating: "liked" | ||
finishedDate: 2023-05-20 | ||
imdb: tt5726616 | ||
--- | ||
|
||
Loved the scene with the dad. You know the one. |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"title": "Carol", | ||
"id": "tt2402927", | ||
"plot": "An aspiring photographer develops an intimate relationship with an older woman in 1950s New York.", | ||
"releaseDate": "2016-01-15", | ||
"runtimeStr": "1h 58min", | ||
"year": "2015", | ||
"companies": [ | ||
"The Weinstein Company", | ||
"Film4", | ||
"Number 9 Films" | ||
], | ||
"genres": [ | ||
"Drama", | ||
"Romance" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
title: "Carol" | ||
finishedDate: 2022-07-22 | ||
rating: "okay" | ||
imdb: "tt2402927" | ||
--- |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"title": "Christine", | ||
"id": "tt4666726", | ||
"plot": "The story of Christine Chubbuck, a 1970s TV reporter struggling with depression and professional frustrations as she tries to advance her career.", | ||
"releaseDate": "2016-10-14", | ||
"runtimeStr": "1h 59min", | ||
"year": "2016", | ||
"companies": [ | ||
"BorderLine Films", | ||
"Fresh Jade", | ||
"The Wonder Club" | ||
], | ||
"genres": [ | ||
"Biography", | ||
"Drama" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
title: "Christine" | ||
finishedDate: 2021-08-21 | ||
rating: "liked" | ||
imdb: "tt4666726" | ||
--- |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"title": "Earthquake Bird", | ||
"id": "tt8178486", | ||
"plot": "An enigmatic translator with a dark past is brought in for questioning after an ex-pat friend, who came between her and her photographer boyfriend, ends up missing and presumed dead.", | ||
"releaseDate": "2019-11-15", | ||
"runtimeStr": "1h 47min", | ||
"year": "2019", | ||
"companies": [ | ||
"Scott Free Productions", | ||
"Trevanna Post", | ||
"Twenty First City" | ||
], | ||
"genres": [ | ||
"Crime", | ||
"Drama", | ||
"Mystery" | ||
] | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
title: "Earthquake Bird" | ||
rating: "liked" | ||
finishedDate: 2021-03-22 | ||
imdb: "tt8178486" | ||
--- | ||
|
||
The storyline isn't necessarily exceptional but there's SUCH a mood throughout the movie | ||
|
||
The cinematography is amazing, everything and everyone is so pretty. I rewatched it twice now because it's just so so pretty and moody |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"title": "Kajillionaire", | ||
"id": "tt8143990", | ||
"plot": "A woman's life is turned upside down when her criminal parents invite an outsider to join them on a major heist they're planning.", | ||
"releaseDate": "2020-09-25", | ||
"runtimeStr": "1h 44min", | ||
"year": "2020", | ||
"companies": [ | ||
"Annapurna Pictures", | ||
"Plan B Entertainment" | ||
], | ||
"genres": [ | ||
"Comedy", | ||
"Crime", | ||
"Drama" | ||
] | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: Kajillionaire | ||
finishedDate: 2023-02-12 | ||
rating: "loved" | ||
imdb: "tt8143990" | ||
--- | ||
|
||
Old Dolio man |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"title": "Ride or Die", | ||
"id": "tt14164234", | ||
"plot": "Rei helps the woman she's been in love with for years escape her abusive husband. While on the run, their feelings for each other catch fire.", | ||
"releaseDate": "2021-04-15", | ||
"runtimeStr": "2h 22min", | ||
"year": "2021", | ||
"companies": [ | ||
"Kôdansha", | ||
"Shogakukan", | ||
"Studio3" | ||
], | ||
"genres": [ | ||
"Drama", | ||
"Romance", | ||
"Thriller" | ||
] | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: "Ride or Die" | ||
finishedDate: 2021-05-22 | ||
rating: "hated" | ||
imdb: "tt14164234" | ||
--- | ||
|
||
I don't know if the manga it's based on is better, but man this wasn't good |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"title": "Breaking Bad", | ||
"id": "tt0903747", | ||
"plot": "A chemistry teacher diagnosed with inoperable lung cancer turns to manufacturing and selling methamphetamine with a former student in order to secure his family's future.", | ||
"releaseDate": "2008-01-20", | ||
"runtimeStr": null, | ||
"year": "2008", | ||
"companies": ["High Bridge Productions", "Gran Via Productions", "Sony Pictures Television"], | ||
"genres": ["Crime", "Drama", "Thriller"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
title: Breaking Bad | ||
rating: "liked" | ||
finishedDate: 2023-05-16 | ||
imdb: "tt0903747" | ||
--- |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"title": "Castlevania", | ||
"id": "tt6517102", | ||
"plot": "A vampire hunter fights to save a besieged city from an army of otherworldly creatures controlled by Dracula.", | ||
"releaseDate": "2017-07-07", | ||
"runtimeStr": null, | ||
"year": "2017", | ||
"companies": [ | ||
"Frederator Studios", | ||
"Mua Film", | ||
"Netflix" | ||
], | ||
"genres": [ | ||
"Animation", | ||
"Action", | ||
"Adventure" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: Castlevania | ||
finishedDate: 2021-11-17 | ||
rating: "loved" | ||
imdb: "tt6517102" | ||
--- | ||
|
||
I really really liked this! I found the artstyle very charming. All the characters having long faces made me simp for most of them, especially the ladies, season 4 could've been a 10 episodes Lenore fan cam and I would have liked it just as much. | ||
|
||
The only thing that I didn't like is that I felt like there was a bit too much fighting, especially in the later seasons. I think I would've liked more talking and more casual scenes between the characters instead of endless fighting. Though, I guess the endless fighting made sense in the context of the story | ||
|
||
Alucard was such a good character, James Callis was amazing, his voice felt so sad, so melancholic at times, wow. I really want to replay Symphony of the Night now! | ||
|
||
I cried a few tears at the end, I loved it, I heavily recommend it |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"title": "Hi Bye, Mama!", | ||
"id": "tt11804034", | ||
"plot": "It's the story of a mother who died and begins a 49-day long project of reincarnation and a husband who has barely begun to live a new life after overcoming the pain of losing his wife.", | ||
"releaseDate": "2020-02-22", | ||
"runtimeStr": null, | ||
"year": "2020", | ||
"companies": ["MI Inc."], | ||
"genres": ["Comedy", "Drama", "Fantasy"] | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: Hi Bye, Mama! | ||
finishedDate: 2022-03-22 | ||
rating: "loved" | ||
imdb: "tt11804034" | ||
--- | ||
|
||
Very good show! It starts off a bit goofy (and definitely does have its goofy moments that we love very much throughout) but it ends up being a very sad show. I did cry a few times. |
Oops, something went wrong.
672b952
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
erika-florist – ./
erika-florist-git-main-princesseuh.vercel.app
erika-florist-princesseuh.vercel.app
erika-florist.vercel.app