This commit is contained in:
@@ -33,7 +33,7 @@ var syncCmd = &cobra.Command{
|
||||
slog.Info("iterate sourceData", "table", "Player", "count", len(sourceData.Player))
|
||||
sourceData.Player.CompareIds(&targetData.Player)
|
||||
slog.Info("iterate sourceData", "table", "MediaLofi", "count source", len(sourceData.MediaLoFi), "count target", len(targetData.MediaLoFi))
|
||||
missing, obsolete := sourceData.MediaLoFi.CompareIds(&targetData.MediaLoFi)
|
||||
missing, obsolete, changed := sourceData.MediaLoFi.CompareIds(&targetData.MediaLoFi)
|
||||
for _, lofi_id := range missing {
|
||||
if !config.DryRun {
|
||||
slog.Info("add MediaLofi", "id", lofi_id)
|
||||
@@ -42,6 +42,13 @@ var syncCmd = &cobra.Command{
|
||||
for _, lofi_id := range obsolete {
|
||||
if !config.DryRun {
|
||||
slog.Info("delete MediaLofi", "id", lofi_id)
|
||||
api.DeleteData(localServer, "media/lofis", lofi_id)
|
||||
}
|
||||
}
|
||||
for _, lofi_id := range changed {
|
||||
if !config.DryRun {
|
||||
slog.Info("update MediaLofi", "id", lofi_id)
|
||||
// api.UpdateData(localServer, "media/lofis", sourceData.MediaLoFi.GetMediaLofi(lofi_id))
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user