Code Monkey home page Code Monkey logo

Comments (6)

edent avatar edent commented on May 18, 2024 2

Sketching an idea out, would it make sense to have this in config.ini?

[Directory]
key=%Y-%m-%d

Then, in filesystem.py

from configparser import ConfigParser
__DIR__ = None

def get_dir():
    global __DIR__
    if __DIR__ is not None:
        return __DIR__

    config_file = '%s/config.ini' % constants.application_directory
    if not path.exists(config_file):
        return None

    config = ConfigParser()
    config.read(config_file)
    if('Directory' not in config.sections()):
        return None

    __DIR__ = config.get('Directory', 'dir')
    return __DIR__

Which would then allow you to do

time.strftime(__DIR__, time_obj) and path.append(time.strftime(__DIR__, metadata['date_taken']))

I'm happy to write a PR if that looks suitable? Of course, it only lets you set a date based path, so no good if you want /place/date or anything like that.

from elodie.

jmathai avatar jmathai commented on May 18, 2024 1

PR merged. You can now customize the folder path as documented here. https://github.com/jmathai/elodie#create-your-own-folder-structure

Customizing the file name is being tracked in #107.

from elodie.

jmathai avatar jmathai commented on May 18, 2024

@patricksan A few folks have asked about this. The ability to define what the folder structure is would be nice. The folder names can't have reserved characters though.

You may want /%location%/%date% in addition to just wanting different date formats.

from elodie.

waynew avatar waynew commented on May 18, 2024

I think something to the effect of defining the format string like so:

FILENAME_FORMAT = "/{exif.date:%Y-%m-%d}/{exif.location}"

I don't know that I see a problem with putting reserved (i.e. path separator) characters in. Some may want a slightly different folder structure. Here are some I can think of off the top of my head:

  • (current) /{date:%Y-%d-%b}/{location}/{filename}
  • /{date:%Y-%m-%d}/{location}/{filename}
  • /{location}/{date:%Y-%m-%d}/{filename}
  • /{date:%Y}/{date:%m}/{date:%d}/{filename}

from elodie.

jmathai avatar jmathai commented on May 18, 2024

@waynew I like that format and I think it's something we can easily parse.

There are some considerations to keep in mind though. Right now, for example, the leaf folder can be either a location name or an album name. If the album exists in EXIF that takes precedent over location.

I think we want to keep that level of customization included when we try to solve this.

from elodie.

jmathai avatar jmathai commented on May 18, 2024

PR looks great. Moving discussion there.

from elodie.

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.