diff --git a/main.go b/main.go index fc7db58..a058762 100644 --- a/main.go +++ b/main.go @@ -7,15 +7,15 @@ import ( ) // WP Config -const baseUrl = "https://slowtwitch.cloud/" -const wordpressKey = "admin@slowtwitch.cloud" -const wordpressSecret = "rcI0 7qAM Q1CR xi6n sGcB 4XFN" +const baseUrl = "http://go-api-playground.local/" +const wordpressKey = "admin" +const wordpressSecret = "7ZeY ZCwp 3DwL EBAK vGtf NW9J" // DB Config const slowtwitchAdminUser = "admin" const slowtwitchAdminPass = "yxnh93Ybbz2Nm8#mp28zCVv" const slowtwitchDbName = "slowtwitch" -const migrationDbName = "slowtwitch_transfer" +const migrationDbName = "slowtwitch_transfer_threaded_test" const federatedDbUrl = "slowtwitch.northend.network" const federatedDbPort = "3306" diff --git a/results.txt b/results.txt index be57bfa..6a9894e 100644 Binary files a/results.txt and b/results.txt differ diff --git a/services/migration/migrate-posts.go b/services/migration/migrate-posts.go index 9aa4fbe..7d95bf9 100644 --- a/services/migration/migrate-posts.go +++ b/services/migration/migrate-posts.go @@ -180,7 +180,6 @@ func (migration MigratePosts) Execute() []PostResult { } imageResults = append(imageResults, imageResult) //replace old links with new in post html - //TODO Wordpress path vs link? If path works I prefer that newImagePath := "/wp-content/uploads/" + wordpressImage.MediaDetails.File html = strings.ReplaceAll(html, imagePath, newImagePath) //create redirect @@ -394,12 +393,3 @@ func updateAcfImages(imageResults []ImageResult, postId int, baseUrl, user, pass } } } - -func getContentType(filename string) string { - if strings.Contains(filename, "png") { - return ".png" - } else if strings.Contains(filename, "gif") { - return ".gif" - } - return ".jpeg" -} diff --git a/services/slowtwitch/get-post-base.go b/services/slowtwitch/get-post-base.go index 323d2e7..25edb67 100644 --- a/services/slowtwitch/get-post-base.go +++ b/services/slowtwitch/get-post-base.go @@ -10,6 +10,7 @@ type SlowtwitchPostBase struct { CategoryIds []int Title string Author string + AuthorEmail string Description string DatePublished sql.NullTime Swim bool @@ -20,8 +21,8 @@ type SlowtwitchPostBase struct { func GetPostBase(id int, db *sql.DB) (SlowtwitchPostBase, error) { var output SlowtwitchPostBase //Get Base - row := db.QueryRow("select ID, Title, LinkOwner, Add_Date, Description, (tag_swim = b'1'), (tag_bike = b'1'), (tag_run = b'1') from glinks_Links where ID = ?", id) - err := row.Scan(&output.Id, &output.Title, &output.Author, &output.DatePublished, &output.Description, &output.Swim, &output.Bike, &output.Run) + row := db.QueryRow("select ID, Title, LinkOwner, Contact_Email, Add_Date, Description, (tag_swim = b'1'), (tag_bike = b'1'), (tag_run = b'1') from glinks_Links where ID = ?", id) + err := row.Scan(&output.Id, &output.Title, &output.Author, &output.AuthorEmail, &output.DatePublished, &output.Description, &output.Swim, &output.Bike, &output.Run) if err != nil { return output, err