manul sync backend works now

This commit is contained in:
Sticks
2025-05-20 13:01:02 -04:00
parent 7aa2dee280
commit 96abb94f21
9 changed files with 397 additions and 147 deletions

View File

@ -1,8 +1,9 @@
package structs
type SyncData struct {
Followers []FanslyFollowResponse `json:"followers"` // List of followers
Subscriptions []Subscription `json:"subscriptions"` // List of subscriptions
Followers []string `json:"followers"` // List of followers
Subscriptions []Subscription `json:"subscriptions"` // List of subscriptions
PasteURL string `json:"paste_url"` // URL of the paste
}
type Config struct {
@ -35,7 +36,7 @@ func NewConfig() *Config {
SyncInterval: 8,
LastSyncTime: "",
LastSyncData: SyncData{
Followers: []FanslyFollowResponse{},
Followers: []string{},
Subscriptions: []Subscription{},
},
}
@ -51,7 +52,7 @@ func NewConfigFromOld(oldConfig *OldConfig) *Config {
SyncInterval: oldConfig.SyncInterval,
LastSyncTime: "",
LastSyncData: SyncData{
Followers: []FanslyFollowResponse{},
Followers: []string{},
Subscriptions: []Subscription{},
},
}

View File

@ -5,14 +5,17 @@ type FanslyBaseResponse[T any] struct {
Response T `json:"response"` // The response data, type of T
}
type FanslyBaseResponseAsArray[T any] struct {
Success bool `json:"success"` // Indicates if the request was successful
Response []T `json:"response"` // The response data, type of T
}
type FanslyAccountResponse struct {
Account FanslyAccount `json:"account"`
}
type FanslyFollowResponse struct {
Followers []struct {
FollowerID string `json:"followerId"` // The ID of the follower
}
FollowerID string `json:"followerId"` // The ID of the follower
}
type FanslySubscriptionResponse struct {

View File

@ -4,7 +4,7 @@ type SyncProgressEvent struct {
// The current step of the sync process.
Step string `json:"step"`
// The current percent done of the sync process.
PercentDone int `json:"percent_done"`
PercentDone float64 `json:"percent_done"`
// The current count of the current step of the sync process.
Count int `json:"current_count"`
// The total count of the current step of the sync process.