[cli] Skip export with bad time stamp (#2702)

## Description

## Tests
This commit is contained in:
Neeraj Gupta
2024-08-14 17:14:51 +05:30
committed by GitHub
21 changed files with 32 additions and 20 deletions

View File

@@ -25,4 +25,4 @@ ente [flags]
* [ente export](ente_export.md) - Starts the export process
* [ente version](ente_version.md) - Prints the current version
###### Auto generated by spf13/cobra on 22-Jun-2024
###### Auto generated by spf13/cobra on 14-Aug-2024

View File

@@ -16,4 +16,4 @@ Manage account settings
* [ente account list](ente_account_list.md) - list configured accounts
* [ente account update](ente_account_update.md) - Update an existing account's export directory
###### Auto generated by spf13/cobra on 22-Jun-2024
###### Auto generated by spf13/cobra on 14-Aug-2024

View File

@@ -20,4 +20,4 @@ ente account add [flags]
* [ente account](ente_account.md) - Manage account settings
###### Auto generated by spf13/cobra on 22-Jun-2024
###### Auto generated by spf13/cobra on 14-Aug-2024

View File

@@ -18,4 +18,4 @@ ente account get-token [flags]
* [ente account](ente_account.md) - Manage account settings
###### Auto generated by spf13/cobra on 22-Jun-2024
###### Auto generated by spf13/cobra on 14-Aug-2024

View File

@@ -16,4 +16,4 @@ ente account list [flags]
* [ente account](ente_account.md) - Manage account settings
###### Auto generated by spf13/cobra on 22-Jun-2024
###### Auto generated by spf13/cobra on 14-Aug-2024

View File

@@ -19,4 +19,4 @@ ente account update [flags]
* [ente account](ente_account.md) - Manage account settings
###### Auto generated by spf13/cobra on 22-Jun-2024
###### Auto generated by spf13/cobra on 14-Aug-2024

View File

@@ -22,4 +22,4 @@ Commands for admin actions like disable or enabling 2fa, bumping up the storage
* [ente admin list-users](ente_admin_list-users.md) - List all users
* [ente admin update-subscription](ente_admin_update-subscription.md) - Update subscription for user
###### Auto generated by spf13/cobra on 22-Jun-2024
###### Auto generated by spf13/cobra on 14-Aug-2024

View File

@@ -18,4 +18,4 @@ ente admin delete-user [flags]
* [ente admin](ente_admin.md) - Commands for admin actions
###### Auto generated by spf13/cobra on 22-Jun-2024
###### Auto generated by spf13/cobra on 14-Aug-2024

View File

@@ -18,4 +18,4 @@ ente admin disable-2fa [flags]
* [ente admin](ente_admin.md) - Commands for admin actions
###### Auto generated by spf13/cobra on 22-Jun-2024
###### Auto generated by spf13/cobra on 14-Aug-2024

View File

@@ -18,4 +18,4 @@ ente admin disable-passkey [flags]
* [ente admin](ente_admin.md) - Commands for admin actions
###### Auto generated by spf13/cobra on 22-Jun-2024
###### Auto generated by spf13/cobra on 14-Aug-2024

View File

@@ -18,4 +18,4 @@ ente admin get-user-id [flags]
* [ente admin](ente_admin.md) - Commands for admin actions
###### Auto generated by spf13/cobra on 22-Jun-2024
###### Auto generated by spf13/cobra on 14-Aug-2024

View File

@@ -17,4 +17,4 @@ ente admin list-users [flags]
* [ente admin](ente_admin.md) - Commands for admin actions
###### Auto generated by spf13/cobra on 22-Jun-2024
###### Auto generated by spf13/cobra on 14-Aug-2024

View File

@@ -23,4 +23,4 @@ ente admin update-subscription [flags]
* [ente admin](ente_admin.md) - Commands for admin actions
###### Auto generated by spf13/cobra on 22-Jun-2024
###### Auto generated by spf13/cobra on 14-Aug-2024

View File

@@ -13,4 +13,4 @@ Authenticator commands
* [ente](ente.md) - CLI tool for exporting your photos from ente.io
* [ente auth decrypt](ente_auth_decrypt.md) - Decrypt authenticator export
###### Auto generated by spf13/cobra on 22-Jun-2024
###### Auto generated by spf13/cobra on 14-Aug-2024

View File

@@ -16,4 +16,4 @@ ente auth decrypt [input] [output] [flags]
* [ente auth](ente_auth.md) - Authenticator commands
###### Auto generated by spf13/cobra on 22-Jun-2024
###### Auto generated by spf13/cobra on 14-Aug-2024

View File

@@ -9,11 +9,15 @@ ente export [flags]
### Options
```
-h, --help help for export
--albums strings Comma-separated list of album names to export
--emails strings Comma-separated list of emails to export files shared with
-h, --help help for export
--hidden to exclude hidden albums, pass --hidden=false (default true)
--shared to exclude shared albums, pass --shared=false (default true)
```
### SEE ALSO
* [ente](ente.md) - CLI tool for exporting your photos from ente.io
###### Auto generated by spf13/cobra on 22-Jun-2024
###### Auto generated by spf13/cobra on 14-Aug-2024

View File

@@ -16,4 +16,4 @@ ente version [flags]
* [ente](ente.md) - CLI tool for exporting your photos from ente.io
###### Auto generated by spf13/cobra on 22-Jun-2024
###### Auto generated by spf13/cobra on 14-Aug-2024

View File

@@ -15,7 +15,7 @@ import (
"strings"
)
var AppVersion = "0.1.17"
var AppVersion = "0.1.18"
func main() {
cliDBPath, err := GetCLIConfigPath()

View File

@@ -12,3 +12,7 @@ func ShouldRetrySync(err error) bool {
return strings.Contains(err.Error(), "read tcp") ||
strings.Contains(err.Error(), "dial tcp")
}
func IsBadTimeStampError(err error) bool {
return strings.Contains(err.Error(), "year outside of range ")
}

View File

@@ -151,7 +151,7 @@ func (r *RemoteFile) GetCreationTime() time.Time {
func (r *RemoteFile) GetModificationTime() time.Time {
value, ok := r.Metadata["modificationTime"]
if !ok {
panic("creationTime not found in metadata")
panic("modificationTime not found in metadata")
}
return time.UnixMicro(int64(value.(float64)))
}

View File

@@ -89,6 +89,10 @@ func (c *ClICtrl) syncFiles(ctx context.Context, account model.Account) error {
continue
} else if existingEntry.IsLivePhoto() && errors.Is(err, model.ErrLiveZip) {
continue
} else if model.IsBadTimeStampError(err) {
log.Printf("Skipping file due to error %s (%d)", existingEntry.GetTitle(), existingEntry.ID)
log.Printf("CreationTime %v, ModidicationTime %v", existingEntry.GetCreationTime(), existingEntry.GetModificationTime())
continue
} else {
return err
}