Cosmetics

This commit is contained in:
Óscar M. Lage 2024-10-24 17:16:17 +02:00
parent e810c7d9a6
commit d4836c1d95
7 changed files with 10 additions and 5 deletions

View File

@ -26,6 +26,7 @@ func LoadBooks() ([]Book, error) {
}
func ProcessBooks(books []Book, update bool) error {
utils.Sep()
fmt.Printf(" B O O K S\n")
utils.Sep()
for _, book := range books {

View File

@ -26,12 +26,12 @@ func LoadMovies() ([]Movie, error) {
}
func ProcessMovies(movies []Movie, update bool) error {
utils.Sep()
fmt.Printf(" M O V I E S\n")
utils.Sep()
for _, movie := range movies {
// Debug print
fmt.Printf("Título: %s, Puntuación: %.1f, Fecha: %s\n",
movie.Title, movie.Rate, movie.Date)
fmt.Printf("Título: %s\n", movie.Title)
// If we're updating, the process is a bit different
if update || !movie.New {
@ -126,6 +126,7 @@ func generateMovieMarkdown(movie Movie) error {
"Subtitle": movie.Year,
"Year": movie.Year,
"Rate": movie.Rate,
"Progress": movie.Progress,
"Image": movie.Image,
"Poster": movie.Poster,
"Background": movie.Background,
@ -138,6 +139,7 @@ func generateMovieMarkdown(movie Movie) error {
// Helper function to update only YAML fields that exist in both the frontmatter and YAML data
func updateFrontmatterWithYAML(frontmatter utils.FrontMatter, movie Movie) utils.FrontMatter {
frontmatter.Progress = movie.Progress
frontmatter.Date = movie.Date
frontmatter.Rate = movie.Rate
return frontmatter

View File

@ -12,6 +12,7 @@ type Movie struct {
Link string `yaml:"link"`
Year int `yaml:"year"`
Rate float64 `yaml:"rate"`
Progress string `yaml:"progress"`
Image string `yaml:"image"`
Poster string `yaml:"poster-image"`
Background string `yaml:"background-image"`

View File

@ -26,6 +26,7 @@ func LoadAlbums() ([]Album, error) {
}
func ProcessAlbum(albumList []Album, update bool) error {
utils.Sep()
fmt.Printf(" M U S I C\n")
utils.Sep()
for _, album := range albumList {

View File

@ -26,12 +26,12 @@ func LoadSeries() ([]Serie, error) {
}
func ProcessSeries(series []Serie, update bool) error {
utils.Sep()
fmt.Printf(" S E R I E S\n")
utils.Sep()
for _, serie := range series {
// Debug print
fmt.Printf("Título: %s, Puntuación: %.1f, Fecha: %s\n",
serie.Title, serie.Rate, serie.Date)
fmt.Printf("Título: %s\n", serie.Title)
// If we're updating, the process is a bit different
if update || !serie.New {

View File

@ -14,7 +14,6 @@ import (
func main() {
// Load .env file
utils.LoadConfig()
utils.Sep()
// --media parameter
media := flag.String("media", "", "Specify the media type to process: movies, series, books, games, or music")

View File

@ -4,6 +4,7 @@ link: "{{ .Link }}"
subtitle: "{{ .Subtitle }}"
year: {{ .Year }}
rate: {{ .Rate }}
progress: {{ .Progress }}
image: {{ .Image }}
poster-image: {{ .Poster }}
background-image: {{ .Background }}