🎨 Add more file formats supporting snapshots comparing https://github.com/siyuan-note/siyuan/issues/8438

This commit is contained in:
Daniel 2023-06-03 15:40:51 +08:00
parent 7fe8568951
commit b5087a5eb1
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -165,6 +165,7 @@ type LeftRightDiff struct {
type DiffFile struct {
FileID string `json:"fileID"`
Title string `json:"title"`
Path string `json:"path"`
Updated int64 `json:"updated"`
}
@ -209,6 +210,7 @@ func DiffRepoSnapshots(left, right string) (ret *LeftRightDiff, err error) {
ret.AddsLeft = append(ret.AddsLeft, &DiffFile{
FileID: removeRight.ID,
Title: title,
Path: removeRight.Path,
Updated: removeRight.Updated,
})
}
@ -225,6 +227,7 @@ func DiffRepoSnapshots(left, right string) (ret *LeftRightDiff, err error) {
ret.RemovesRight = append(ret.RemovesRight, &DiffFile{
FileID: addLeft.ID,
Title: title,
Path: addLeft.Path,
Updated: addLeft.Updated,
})
}
@ -241,6 +244,7 @@ func DiffRepoSnapshots(left, right string) (ret *LeftRightDiff, err error) {
ret.UpdatesLeft = append(ret.UpdatesLeft, &DiffFile{
FileID: updateLeft.ID,
Title: title,
Path: updateLeft.Path,
Updated: updateLeft.Updated,
})
}
@ -257,6 +261,7 @@ func DiffRepoSnapshots(left, right string) (ret *LeftRightDiff, err error) {
ret.UpdatesRight = append(ret.UpdatesRight, &DiffFile{
FileID: updateRight.ID,
Title: title,
Path: updateRight.Path,
Updated: updateRight.Updated,
})
}