diff --git a/config.go b/config.go index c929576..b240eee 100644 --- a/config.go +++ b/config.go @@ -43,7 +43,7 @@ const ( "Category: {{.Category}}\r\nCondition: {{.Condition}}\r\nCreated: {{.Created}}\r\n\r\n{{.Text}}\r\n" Useragent string = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) " + "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" - DefaultAdNameTemplate string = "{{.Slug}}-{{.Id}}" + DefaultAdNameTemplate string = "{{.Slug}}" ) const Usage string = `This is kleingebaeck, the kleinanzeigen.de backup tool. diff --git a/main_test.go b/main_test.go index 4244175..f9dd829 100644 --- a/main_test.go +++ b/main_test.go @@ -438,16 +438,18 @@ func SetIntercept(ads []Adsource) { // we just use 2 images, put this here for _, image := range []string{"t/1.jpg", "t/2.jpg"} { - httpmock.RegisterResponder("GET", image, httpmock.NewBytesResponder(200, GetImage(image))) + httpmock.RegisterResponder("GET", image, + httpmock.NewBytesResponder(200, GetImage(image))) } } func VerifyAd(ad AdConfig) error { - body := ad.Title + ad.Price + ad.Id + "Kleinanzeigen => " + ad.Category + ad.Condition + ad.Created + body := ad.Title + ad.Price + ad.Id + "Kleinanzeigen => " + + ad.Category + ad.Condition + ad.Created // prepare ad dir name using DefaultAdNameTemplate - c := Config{Adnametemplate: DefaultAdNameTemplate} + c := Config{Adnametemplate: "{{ .Slug }}"} adstruct := Ad{Slug: ad.Slug, Id: ad.Id} addir, err := AdDirName(&c, &adstruct) if err != nil {