Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions adapters/googlePhotos/cmdFromGooglePhotos.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type TakeoutCmd struct {
KeepUntitled bool
KeepArchived bool
KeepJSONLess bool
KeepFailedVideos bool
InclusionFlags cliflags.InclusionFlags
BannedFiles namematcher.List
TakeoutTag bool
Expand Down Expand Up @@ -74,6 +75,7 @@ func (toc *TakeoutCmd) RegisterFlags(flags *pflag.FlagSet, cmd *cobra.Command) {
flags.StringVar(&toc.PartnerSharedAlbum, "partner-shared-album", "", "Add partner's photo to the specified album name")
flags.BoolVarP(&toc.KeepArchived, "include-archived", "a", true, "Import archived Google Photos")
flags.BoolVarP(&toc.KeepJSONLess, "include-unmatched", "u", false, "Import photos that do not have a matching JSON file in the takeout")
flags.BoolVar(&toc.KeepFailedVideos, "include-failed-videos", false, "Import videos that have been marked by Google Photos as failed")
flags.Var(&toc.BannedFiles, "ban-file", "Exclude a file based on a pattern (case-insensitive). Can be specified multiple times.")
flags.BoolVar(&toc.TakeoutTag, "takeout-tag", true, "Tag uploaded photos with a tag \"{takeout}/takeout-YYYYMMDDTHHMMSSZ\"")
flags.BoolVar(&toc.PeopleTag, "people-tag", true, "Tag uploaded photos with tags \"people/name\" found in the JSON file")
Expand Down
6 changes: 3 additions & 3 deletions adapters/googlePhotos/googlephotos.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,12 @@ func (toc *TakeoutCmd) passOneFsWalk(ctx context.Context, w fs.FS) error {
toc.processor.RecordNonAsset(ctx, fshelper.FSName(w, name), finfo.Size(), fileevent.DiscoveredUnsupported, "reason", "unsupported file type")
return nil
case filetypes.TypeVideo:
if strings.Contains(name, "Failed Videos") {
if !toc.KeepFailedVideos && strings.Contains(name, "Failed Videos") {
toc.processor.RecordAssetDiscardedImmediately(ctx, fshelper.FSName(w, name), finfo.Size(), fileevent.DiscardedFiltered, "can't upload failed videos")
return nil
} else {
toc.processor.RecordAssetDiscovered(ctx, fshelper.FSName(w, name), finfo.Size(), fileevent.DiscoveredVideo)
}

toc.processor.RecordAssetDiscovered(ctx, fshelper.FSName(w, name), finfo.Size(), fileevent.DiscoveredVideo)
case filetypes.TypeImage:
toc.processor.RecordAssetDiscovered(ctx, fshelper.FSName(w, name), finfo.Size(), fileevent.DiscoveredImage)
}
Expand Down