From ee3ae47d4f7bf3cfaabbe890af9a9ab1d27cc24b Mon Sep 17 00:00:00 2001 From: Ross Trottier Date: Wed, 29 May 2024 09:11:01 -0600 Subject: [PATCH] fixed broken images issue --- main.go | 8 ++++---- results.txt | Bin 237746 -> 15342 bytes services/migration/migrate-authors.go | 2 ++ services/migration/migrate-posts.go | 17 ++++++++++++++--- services/wordpress/create-image.go | 11 ++++++++--- 5 files changed, 28 insertions(+), 10 deletions(-) diff --git a/main.go b/main.go index a18304e..fc7db58 100644 --- a/main.go +++ b/main.go @@ -7,15 +7,15 @@ import ( ) // WP Config -const baseUrl = "http://go-api-playground.local/" -const wordpressKey = "admin" -const wordpressSecret = "KStj VH7E 9UZf FV8C ptGQ F4Tl" +const baseUrl = "https://slowtwitch.cloud/" +const wordpressKey = "admin@slowtwitch.cloud" +const wordpressSecret = "rcI0 7qAM Q1CR xi6n sGcB 4XFN" // DB Config const slowtwitchAdminUser = "admin" const slowtwitchAdminPass = "yxnh93Ybbz2Nm8#mp28zCVv" const slowtwitchDbName = "slowtwitch" -const migrationDbName = "slowtwitch_transfer_threaded_test" +const migrationDbName = "slowtwitch_transfer" const federatedDbUrl = "slowtwitch.northend.network" const federatedDbPort = "3306" diff --git a/results.txt b/results.txt index eead3985e786ead1ba28f86f002b8139efee60aa..be57bfaa81b2d8b93770dd6d7e1aec9dede8fcce 100644 GIT binary patch delta 949 zcmXX_T}V_x6rP#8f*3`*B8Z@@xhAsW-dnq7Vyv6_Cb=f-b?!CPOt6GfED0fSLn#z- zJ>&_3P>~?%!4-*=UKELX%Y6_9LA1@sKoNTI!OmQLm^0_^`_6Y~<}R*Y`a7`jgTqIy zksHXzxJ6t0fJPg%?^-Ax37g!F_ZAqV${TX4QexTSK}cL}rEX6Zw_rjQ@z6(Z;kfE+ z&$Zxb+{SR7LlECo#C%=x!`@A0hqfI%Z^1%~3zmMFl-o$NaIHqzX$CV`0QbT|=atYq zbq5c^!lzZT0O)t$s-Yt^DJyO(EU$1Hsam0`n7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gSsTaigqE+0~)OajkcIK^o*mi(^1>$NbPp8SH#*wioVQK0?>q>-vV_{7Z#@6vi(r^bRpC|zXj@^E`+-0 zSwP*(2SDA6F`!<4%g{9~T5ooj`Y3tA=jj;-_X65=oco%@)eQ+xhrea&u!bo9Jm!}^ zJUWP(kqpiku5R@>-{H+nhBs5Undo15H+7qdErxefx0$$7c=uv5q8d|%O0RTEbV@20GpxKemGW!1!$l7TR#$waNfyD6(Ct`y!)Sv7H`@NUX#!<7!z zt8cRg3w1GT*5Kq!KqiBO2|&M%b138d$arcLb1I0&m`_1w<>}m+k)f_!>!qrdo7GD- z-^vj;)tnDdl$TjKBj1R;nD(JznTLAU8*YTVKKlgpXZ_T)r#<%Oe)q7)&y0Eu4jw#_ zFjG32V^#ADn)D1eMm7=P 0 && imageResult.IsSuccess { output = append(output, imageResult.WordpressId) } } @@ -392,3 +394,12 @@ 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/wordpress/create-image.go b/services/wordpress/create-image.go index b02972e..0b2b887 100644 --- a/services/wordpress/create-image.go +++ b/services/wordpress/create-image.go @@ -14,9 +14,14 @@ type CreateImage struct { } type CreateImageResponse struct { - Id int `json:"id"` - Link string `json:"link"` - Slug string `json:"slug"` + Id int `json:"id"` + Link string `json:"link"` + Slug string `json:"slug"` + MediaDetails MediaDetails `json:"media_details"` +} + +type MediaDetails struct { + File string `json:"file"` } func (parameters *CreateImage) Execute(baseUrl, user, pass string) (CreateImageResponse, error) {