Compare commits

..

No commits in common. "d4836c1d9510e4d5d3f05f87940c3eecf7d70bad" and "d8a4bfd6f314ce3c045d58dd20871c0d590689a3" have entirely different histories.

8 changed files with 6 additions and 11 deletions

View File

@ -26,7 +26,6 @@ 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\n", movie.Title)
fmt.Printf("Título: %s, Puntuación: %.1f, Fecha: %s\n",
movie.Title, movie.Rate, movie.Date)
// If we're updating, the process is a bit different
if update || !movie.New {
@ -126,7 +126,6 @@ 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,
@ -139,7 +138,6 @@ 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,7 +12,6 @@ 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,7 +26,6 @@ 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\n", serie.Title)
fmt.Printf("Título: %s, Puntuación: %.1f, Fecha: %s\n",
serie.Title, serie.Rate, serie.Date)
// If we're updating, the process is a bit different
if update || !serie.New {

View File

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

View File

@ -97,7 +97,7 @@ func SaveUpdatedMarkdown(filepath string, frontmatter FrontMatter, content strin
fileContent := string(fileBytes)
fieldPatterns := map[string]string{
"progress": `(?m)^progress: (.*)%$`,
"progress": `(?m)^progress: "(.*)%"$`,
"episode": `(?m)^episode: "(.*)"$`,
"date": `(?m)^date: "(.*)"$`,
"rate": `(?m)^rate: (\d+\.?\d*)$`,