updating get editors to look for email too

This commit is contained in:
Ross Trottier 2024-06-03 09:13:34 -06:00
parent ee3ae47d4f
commit cb6829f175
4 changed files with 7 additions and 16 deletions

View File

@ -7,15 +7,15 @@ import (
) )
// WP Config // WP Config
const baseUrl = "https://slowtwitch.cloud/" const baseUrl = "http://go-api-playground.local/"
const wordpressKey = "admin@slowtwitch.cloud" const wordpressKey = "admin"
const wordpressSecret = "rcI0 7qAM Q1CR xi6n sGcB 4XFN" const wordpressSecret = "7ZeY ZCwp 3DwL EBAK vGtf NW9J"
// DB Config // DB Config
const slowtwitchAdminUser = "admin" const slowtwitchAdminUser = "admin"
const slowtwitchAdminPass = "yxnh93Ybbz2Nm8#mp28zCVv" const slowtwitchAdminPass = "yxnh93Ybbz2Nm8#mp28zCVv"
const slowtwitchDbName = "slowtwitch" const slowtwitchDbName = "slowtwitch"
const migrationDbName = "slowtwitch_transfer" const migrationDbName = "slowtwitch_transfer_threaded_test"
const federatedDbUrl = "slowtwitch.northend.network" const federatedDbUrl = "slowtwitch.northend.network"
const federatedDbPort = "3306" const federatedDbPort = "3306"

Binary file not shown.

View File

@ -180,7 +180,6 @@ func (migration MigratePosts) Execute() []PostResult {
} }
imageResults = append(imageResults, imageResult) imageResults = append(imageResults, imageResult)
//replace old links with new in post html //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 newImagePath := "/wp-content/uploads/" + wordpressImage.MediaDetails.File
html = strings.ReplaceAll(html, imagePath, newImagePath) html = strings.ReplaceAll(html, imagePath, newImagePath)
//create redirect //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"
}

View File

@ -10,6 +10,7 @@ type SlowtwitchPostBase struct {
CategoryIds []int CategoryIds []int
Title string Title string
Author string Author string
AuthorEmail string
Description string Description string
DatePublished sql.NullTime DatePublished sql.NullTime
Swim bool Swim bool
@ -20,8 +21,8 @@ type SlowtwitchPostBase struct {
func GetPostBase(id int, db *sql.DB) (SlowtwitchPostBase, error) { func GetPostBase(id int, db *sql.DB) (SlowtwitchPostBase, error) {
var output SlowtwitchPostBase var output SlowtwitchPostBase
//Get Base //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) 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.DatePublished, &output.Description, &output.Swim, &output.Bike, &output.Run) err := row.Scan(&output.Id, &output.Title, &output.Author, &output.AuthorEmail, &output.DatePublished, &output.Description, &output.Swim, &output.Bike, &output.Run)
if err != nil { if err != nil {
return output, err return output, err