diff options
-rwxr-xr-x | share/hydractl/sync-media | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/share/hydractl/sync-media b/share/hydractl/sync-media index 12d9b69..48b03b7 100755 --- a/share/hydractl/sync-media +++ b/share/hydractl/sync-media @@ -53,6 +53,10 @@ function sync_media_add { # Add meta files, making sure they're handled directly by Git function sync_media_add_metadata { + # Playlist files + find -name '*.m3u' -type l -exec git annex unlock {} \; + find -name '*.m3u' -exec git add {} \; + # Koreader metadata files find -name metadata.pdf.lua -type l -exec git annex unlock {} \; find -name metadata.pdf.lua -exec git add {} \; @@ -206,13 +210,32 @@ for folder in $REPOSITORIES; do cd $CACHE/$folder echo "Syncing $CACHE/$folder..." - sync_media_add_metadata - sync_media_playlist_perms + # Ensure the removable volume is in the list of remotes sync_media_ensure_remote $REMOTE $VOLUME/$MEDIA/$folder + + # Ensure the repository is identified sync_media_identity + + # Sync before changing anything, to make sure the history does not have + # conflicts with other remotes + git annex sync + + # Fix any playlist permissions + sync_media_playlist_perms + + # Process metadata + sync_media_add_metadata + + # Add new content, and catch up changes sync_media_add + + # Sync everything again git annex sync + + # Get all that needs to be got sync_media_getall $CACHE/$folder + + # Repository maintenance sync_media_fsck sync_media_dropunused ) |