Git Product home page Git Product logo

Comments (6)

pandiloko avatar pandiloko commented on August 22, 2024

The uploaded photos usually have the date in the filename (failing that there should also be a date in the exif metadata). In Nextcloud there is the same problem. I used to touch the files to set them to appropriate timestamp. Here is the script I use:

#format 2021-02-18_201122_5428.mov
for i in $(find . -type f -mtime -40 );do
   tstamp=$(basename "$i" | cut  -d"_" -f1-2 | tr -d '_-');
       echo $tstamp;
   tstamp=$(echo $tstamp | sed  -E 's/(.{12})(.*)/\1\.\2/g')
       touch -t $tstamp "$i";
done
#confirm changes with `docker-compose exec --user www-data app php occ files:scan --path=/path/to/Camera-Uploads`

Now, I tried the same with Seafile but so far I wasn't able to change the timestamp in any file while using Seadrive Daemon in a Linux Server (no gui). Is that a limitation of Seadrive or does it happen also if I synchronize the library with Seafile client?

Please give us at least a workaround. Thank you.

from seafile-ios.

pandiloko avatar pandiloko commented on August 22, 2024

So I did a quick test and this technique seems to work for libraries/folders synchronized through Seafile Desktop Client. It is a pain to synchronize a big library just to change the timestamps so again: is there some configuration we can change to enable timestamp modification with Seadrive? Thank you

EDIT: Turns out it took a couple of minutes to synchronize the timestamp changes to the server but the previous script worked like a charm updating the timestamps through SeaDrive. More than 6000 files correctly "timestamped". Nevertheless the App should preserve the file metadata when uploading.

To clarify the actual format for iOS Photos is IMG_20161224_191347_0394.JPG so there is a small change in the cut command. Again the complete working script:

#format IMG_20161224_191347_0394.JPG
for i in $(find . -type f -mtime -40 );do
    tstamp=$(basename "$i" | cut  -d"_" -f2-3 | tr -d '_-');
        echo $tstamp;
    tstamp=$(echo $tstamp | sed  -E 's/(.{12})(.*)/\1\.\2/g')
        touch -t $tstamp "$i";
done

from seafile-ios.

pandiloko avatar pandiloko commented on August 22, 2024

surprise twist: after applying the script and correcting all the timestamps, the auto upload function thinks the local file (in the iPhone) differs from the remote file (on the Seafile server) and re-uploads everything again!!!. We are talking here about near to 7000 files so yeah... my phone is on fire today.

TLDR: I take everything back about the possible workaround. There seems to be no possibility of fixing the data on the server end: the iOS Seafile app must send the real timestamp on the first place.

Pleasee fix this. Thanks

from seafile-ios.

pandiloko avatar pandiloko commented on August 22, 2024

I discovered a new workaround and I think in my case it will stay this way long term. I'll explain: I also have a remote backup in a cloud service where apparently the original timestamps are honored. In the server where Seafile runs I have both the cloud and Seadrive mounted with fuse (Seadrive). I then have a cron task in place which synchronizes (rsync -avhP ...) the files from the cloud to Seadrive preserving timestamps and everything.

This works and I think in my case is even better because I only have to upload the files one time from my phone while the sync to Seafiles happens automatically on the server. This has also the advantage of having a backup of the small videos that the iPhone takes with the so-called "live photos" which were missing from the Seafile "Automatic Upload".

from seafile-ios.

floco avatar floco commented on August 22, 2024

I have the same issue.
Thanks for the workaround. I may do this too but of course would prefer not to depend on a third party cloud.
Anyone knows if the limitation comes from the iOS client or from the API (found this related issue haiwen/seafile#1456) ?

from seafile-ios.

VanLampe avatar VanLampe commented on August 22, 2024

Thanks for sharing your workaround @pandiloko - I think this may be a solution an I'll give it a try. Nevertheless, I also think, that the photos should contain the meta data to be able to sort them by the real time they where taken.

Sorting photos by the name also works at the moment, but won't work if they get renamed.

And: Its not possible to change the order by name to show the latest photos first. It would be great if we could choose between asc and desc order.

from seafile-ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.