1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-07-22 17:18:37 +00:00

Add API endpoint to import OPML file

This commit is contained in:
Frédéric Guillot 2018-04-29 18:56:40 -07:00
parent 7a1653a2e9
commit 5cacae6cf2
9 changed files with 96 additions and 23 deletions

View file

@ -23,8 +23,7 @@ type Handler struct {
func (h *Handler) Export(userID int64) (string, error) {
feeds, err := h.store.Feeds(userID)
if err != nil {
logger.Error("[OPML:Export] %v", err)
return "", errors.New("unable to fetch feeds")
return "", err
}
var subscriptions SubcriptionList
@ -74,7 +73,7 @@ func (h *Handler) Import(userID int64, data io.Reader) error {
err := h.store.CreateCategory(category)
if err != nil {
logger.Error("[OPML:Import] %v", err)
return fmt.Errorf(`unable to create this category: "%s"`, subscription.CategoryName)
return fmt.Errorf(`unable to create this category: %q`, subscription.CategoryName)
}
}
}