Skip to content

Rework output generation #27

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

Closed
wants to merge 5 commits into from
Closed

Conversation

aw-was-here
Copy link
Contributor

@aw-was-here aw-was-here commented Mar 6, 2021

  • Metadata

    • Introduce a new metadata dictionary idea so that
      a lot more than artist and title track data may
      be passed around
    • Replace the CURRENTARTIST, CURRENTSONG globals
      with a new CURRENTMETA to use that new dictionary
    • Rework lots of places where ARTIST/SONG stuff
      was being used to check for new track, etc. to again
      use the new metadata dictionary
  • Added Utils

    • Moved more code out of the main Python script and into
      a new utils module
    • Utils module now has a function to use tinytag to
      fill in missing metadata given a file. tinytag
      supports many formats, has a good license, and is
      native python. It is missing a few things that would
      be nice but for the most part, it is a great fit here
    • TemplateHandler class that is used in various locations
      to perform Jinja2 operations. Class was used to take
      advantage of Jinja2 caching for multiple locations
    • writetxttrack rewritten to take advantage of templating
    • update_javascript updated to take advantage of templating.
    • Additionally, update_javascript now supports writing
      cover images to server up over HTTP
  • Serato support changes:

    • Simplify how to process remote vs. local by
      embedding that logic in the class and renaming the
      class to reflect that. This change
      meant removing Nones from a few places, adding some
      functionality to the constructor, etc, but
      it feels a lot cleaner now and makes adding
      functionality (like metadata!) easier
    • 'Empty' adats in SeratoHandler are now really
      ChunkTrackADAT objects.
    • New ChunkTrackADATs have starttime and updatedat times
      of now(). This also means 'empty' ADATs will be
      'newer' and will automatically get replaced when doing
      deck calculations
    • Strip last character from strings decoded from
      Serato session files to remove the NULL from the
      C-string. This was causing problems all over
      the place, but in particular for reading
      filenames
    • Copy ADAT pathstr to filename
    • Copy ADAT label to publisher
    • add a way to get the currently playing ADAT in
      Now Playing metadata dictionary format
  • UI

    • Removed UI elements for things replaced by templating
    • File and dir pickers now start from previous preference choices
    • Resized the box again
  • Misc

    • Remove unused preference entries from the default
      file
    • Create new 'templates' directory, update and move
      the default HTML template there, and create several new
      sample templates to server as examples
    • Add templates to the pyinstaller specs
  • Documentation updates

    • Remove reference to no longer used preferences
    • Add documentation for templates
      • Clarify some limitations around local vs. remote

Fixes whatsnowplaying#7
Fixes whatsnowplaying#6
Fixes whatsnowplaying#1
Fixes #21
Fixes #11

aw-was-here and others added 5 commits February 5, 2021 14:10
* Add a github action that runs pyinstaller on the
  source for every push and PR
* update requirements.txt to have a few more things
  in it
* add the missing config.ini in the Mac spec file
* change the default paths in the spec files to match
  github

NOTE: The OS X build is doubly-archived because Github
      upload-artifacts is strips permissions. :(
* Major source changes to make it easier to add
  functionality:
  * removed most of the statements spread out in the
    global area/primary thread
  * rework boolean handling and other type fixing
    to be more consistent (e.g., some vars were
    either bool False or a string. now return None
    or a string)
  * Rather than use independent threads, use QThreads
    plus signals to cut back on thread crashes,
    enable thread-to-thread chatter, and more.
  * Along with that Tray class is now the primary
    thread since it is the GUI element that is
    always active.

* config.ini cleanups
  * try/catch for boolean and floats to
    eliminate the two functions and provide
    better default handling
  * this part of the code is still fairly fragile
    and needs more TLC (e.g., no config.ini
    breaks things)
  * changed put to use named args since the list
    is so big and it can be hard to remember
    the order

* pylint code cleanup
  * globals now capitalized
  * variable name cleanups in various places
  * code formatting via yapf

* Version strings replaced with f-strings so
  that __version__ has meaning

* HTTP Server support
  * Added several classes to provide a
    very basic web server
  * Added a few globals to work around
    some limitations of the current track
    name handling. (globals should get
    cleaned up later, again within Qt
    thread model)
  * Added some support in the settings
    window to provide some config to the web
    server as well as error handling
  * renamed writetrack() to writetxttrack()
  * Added a _very_ basic HTML template file
    using string's Template engine
  * changed session reading to avoid a chdir()
    since we need to do that for the webserver
  * Re-arrange the settings a bit to be more logically
    grouped, especially since the formatting options
    for file don't apply to HTTP
  * Make the settings window bigger
  * Update the README

* Misc
  * Several places where global keyword was missing
  * Several places where error checking has been added
  * Cleanup the markdown and add notes for new
    functionality.
- Move Serato code out of the main body and into
  a separate module to allow for future expansion
  to support other software
    
- nowplaying/serato.py module:
  - rewritten session file handler now properly parses
    session files and all documented fields, fixing
    quite a few edge-case artist/title bugs
  - properly decodes those fields as UTF-16-BE
  - Includes a 'get playing song' that should
    handle multi-deck operation under the assumption
    that the 'oldest' track is the one currently playing.
    
  - Remove more globals and simplify a lot of handling
  - add .gitignore to toss pycache dirs away
- Metadata
  - Introduce a new metadata dictionary idea so that
    a lot more than artist and title track data may
    be passed around
  - Replace the CURRENTARTIST, CURRENTSONG globals
    with a new CURRENTMETA to use that new dictionary
  - Rework lots of places where ARTIST/SONG stuff
    was being used to check for new track, etc. to again
    use the new metadata dictionary

- Added Utils
  - Moved more code out of the main Python script and into
    a new utils module
  - Utils module now has a function to use tinytag to
    fill in missing metadata given a file.  tinytag
    supports many formats, has a good license, and is
    native python.  It is missing a few things that would
    be nice but for the most part, it is a great fit here
  - TemplateHandler class that is used in various locations
    to perform Jinja2 operations.  Class was used to take
    advantage of Jinja2 caching for multiple locations
  - writetxttrack rewritten to take advantage of templating
  - update_javascript updated to take advantage of templating.
  - Additionally, update_javascript now supports writing
    cover images to server up over HTTP

- Serato support changes:
  - Simplify how to process remote vs. local by
    embedding that logic in the class and renaming the
    class to reflect that.  This change
    meant removing Nones from a few places, adding some
    functionality to the constructor, etc, but
    it feels a lot cleaner now and makes adding
    functionality (like metadata!) easier
  - 'Empty' adats in SeratoHandler are now really
    ChunkTrackADAT objects.
  - New ChunkTrackADATs have starttime and updatedat times
    of now().  This also means 'empty' ADATs will be
    'newer' and will automatically get replaced when doing
    deck calculations
  - Strip last character from strings decoded from
    Serato session files to remove the NULL from the
    C-string. This was causing problems all over
    the place, but in particular for reading
    filenames
  - Copy ADAT pathstr to filename
  - Copy ADAT label to publisher
  - add a way to get the currently playing ADAT in
    Now Playing metadata dictionary format

- UI
  - Removed UI elements for things replaced by templating
  - File and dir pickers now start from previous
    preference choices
  - Resized the box again

- Misc
  - Remove unused preference entries from the default
    file
  - Create new 'templates' directory, update and move
    the default HTML template there, and create several new
    sample templates to server as examples
  - Add templates to the pyinstaller specs

- Documentation updates
  - Remove reference to no longer used preferences
  - Add documentation for templates
  - Clarify some limitations around local vs. remote
@aw-was-here aw-was-here closed this Apr 2, 2021
@aw-was-here aw-was-here deleted the media branch April 2, 2021 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant