|
|
|
@ -65,9 +65,8 @@ func Scan() (result ScanResult) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//parse input files
|
|
|
|
|
result.ParseShownotes(names[0])
|
|
|
|
|
chapterMarksPath := fmt.Sprintf("chapter-pentaradio-%04d-%02d-%02d.dat", result.Year, result.Month, result.Day)
|
|
|
|
|
result.ParseChapterMarks(chapterMarksPath)
|
|
|
|
|
result.ParseShownotes()
|
|
|
|
|
result.ParseChapterMarks()
|
|
|
|
|
|
|
|
|
|
//collect audio files
|
|
|
|
|
pattern := fmt.Sprintf("pentaradio-%04d-%02d-%02d.*", result.Year, result.Month, result.Day)
|
|
|
|
@ -87,8 +86,12 @@ var monthWords = []string{
|
|
|
|
|
"September", "Oktober", "November", "Dezember",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (scan *ScanResult) ParseShownotes(path string) {
|
|
|
|
|
buf, err := os.ReadFile(path)
|
|
|
|
|
func (scan ScanResult) ShowNotesFile() string {
|
|
|
|
|
return fmt.Sprintf("shownotes-pentaradio-%04d-%02d-%02d.txt", scan.Year, scan.Month, scan.Day)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (scan *ScanResult) ParseShownotes() {
|
|
|
|
|
buf, err := os.ReadFile(scan.ShowNotesFile())
|
|
|
|
|
must(err)
|
|
|
|
|
|
|
|
|
|
expectedTitle := fmt.Sprintf("Pentaradio vom %d. %s %d", scan.Day, monthWords[scan.Month], scan.Year)
|
|
|
|
@ -106,8 +109,12 @@ func (scan *ScanResult) ParseShownotes(path string) {
|
|
|
|
|
scan.Description = match[2]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (scan *ScanResult) ParseChapterMarks(path string) {
|
|
|
|
|
buf, err := os.ReadFile(path)
|
|
|
|
|
func (scan ScanResult) ChapterMarksFile() string {
|
|
|
|
|
return fmt.Sprintf("chapter-pentaradio-%04d-%02d-%02d.dat", scan.Year, scan.Month, scan.Day)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (scan *ScanResult) ParseChapterMarks() {
|
|
|
|
|
buf, err := os.ReadFile(scan.ChapterMarksFile())
|
|
|
|
|
must(err)
|
|
|
|
|
|
|
|
|
|
lineRx := regexp.MustCompile(`^(\d\d:\d\d:\d\d.\d\d\d) (\S.*?\S)(?: <(https?://.*)>)?$`)
|
|
|
|
|