New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{created} filter is not populated version 2.0.x #177
Comments
Hey thanks a lot! But I guess I'll bring that back in the next version to not break old configs. |
this is where my Python-fu is lacking. of course stat is working
how would I get that into the yaml for dynamic path? Before the images would be sorted to /pictures/{YEAR}/{MONTH}/Daily/{DAY} |
So your filesystem tracks the birthtime? I guess organize should detect that by default. I'll try to get that in! |
I cannot reproduce on my local system. rules:
- name: "Show file details"
locations:
- ~/Desktop # or any other folder - you chose
actions:
- python: |
import os
details = fs.getinfo(fs_path, namespaces=["details"])
print("Created:", details.created)
print("MD Change:", details.metadata_changed)
print("Modified:", details.modified)
stat = os.stat(fs.getsyspath(fs_path))
print(stat) |
Actually don't mind my previous comment. organize now falls back to using the stat utility 👍 Should be fixed in 2.0.9. Please try it out! |
It seems to still not populate the created var:
Adding the prev comment to see output and full config of result
Info sake
|
Mh, maybe stat it behaving differently on macOS? What is the output of You can test with this rule: rules:
- name: "Show all file details"
locations:
- ~/Desktop
actions:
- python: |
import subprocess
birth = subprocess.run(
["stat", "-f%B", fs.getsyspath(fs_path)],
capture_output=True,
encoding='utf-8',
).stdout.strip()
print(birth)
Edit: I just discovered that the BSD stat utility is very different from the GNU coreutils one. |
I added support for GNU stat. Please try with the development version:
|
Awesome! after installing the git version: my config
Gives me
YAY!!
or
or
aren't working. AND hopefully this helps you and your other users and i'm not Just being a PITA. |
Glad that it works! Have a look at the last example here. You can now use the good old rules:
- name: Display the creation date
locations: "~/Documents"
filters:
- created
actions:
- echo: "ISO Format: {created.strftime('%Y-%m-%d')}" Edit: I added some documentation here: |
v2.1.0 with the new created code is now officially released 👍 |
yep Closed.!
now has the expected output of
|
👍 - move: "~/Nextcloud/Pictures/2020 - 2029/{created.strftime('%Y/%m/Daily/%d')}/" But I guess yours is more readable! |
good to know and Right as it's formatting the string with vars.. good call. |
Hi Great work on the 2.x stuff..
With the Created filter set and modified config for 2.x it seems that the created variable is not being populated
config:
Output is as follows on SIM
Debug info:
The text was updated successfully, but these errors were encountered: