diff --git a/doc/todo.txt b/doc/todo.txt index ef7682d..26f1a28 100644 --- a/doc/todo.txt +++ b/doc/todo.txt @@ -1,4 +1,3 @@ -- fix: use only 1 item content field - etc: test new parser extensively - fix: loading items (by scrolling down) is glitching while feeds are refreshing diff --git a/src/assets/javascripts/app.js b/src/assets/javascripts/app.js index a77b652..36fff67 100644 --- a/src/assets/javascripts/app.js +++ b/src/assets/javascripts/app.js @@ -252,13 +252,7 @@ var vm = new Vue({ if (this.itemSelectedReadability) return this.itemSelectedReadability - var content = '' - if (this.itemSelectedDetails.content) - content = this.itemSelectedDetails.content - else if (this.itemSelectedDetails.description) - content = this.itemSelectedDetails.description - - return content + return this.itemSelectedDetails.content || '' }, }, watch: { diff --git a/src/storage/item.go b/src/storage/item.go index 0948d13..14182f4 100644 --- a/src/storage/item.go +++ b/src/storage/item.go @@ -84,7 +84,7 @@ func (s *Storage) CreateItems(items []Item) bool { content, image, podcast_url, date_arrived, status ) - values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) on conflict (feed_id, guid) do nothing`, item.GUID, item.FeedId, item.Title, item.Link, item.Date, item.Content, item.ImageURL, item.AudioURL, diff --git a/src/storage/migration.go b/src/storage/migration.go index 58d2c02..e06cfd0 100644 --- a/src/storage/migration.go +++ b/src/storage/migration.go @@ -11,6 +11,7 @@ var migrations = []func(*sql.Tx) error{ m02_feed_states_and_errors, m03_on_delete_actions, m04_item_podcasturl, + m05_move_description_to_content, } var maxVersion = int64(len(migrations)) @@ -242,3 +243,11 @@ func m04_item_podcasturl(tx *sql.Tx) error { } // TODO: description -> content +func m05_move_description_to_content(tx *sql.Tx) error { + sql := ` + update items set content=description + where length(content) = 0 or content is null + ` + _, err := tx.Exec(sql) + return err +}