Giter Site home page Giter Site logo

lucos_media_metadata_api's Introduction

lucos_media_metadata_api

An API for managing media metadata.

Dependencies

  • docker
  • docker-compose

Build-time Dependencies

  • Golang
  • github.com/mattn/go-sqlite3
  • github.com/jmoiron/sqlx

Running

nice -19 docker-compose up -d --no-build

Building

The build is configured to run in Dockerhub when a commit is pushed to the master branch in github.

Running locally

  • Install the build-time dependencies (see above)
  • Run go install
  • Run lucos_media_metadata_api

(The install command should add this to your $GOBIN. Make sure you've added this to your $PATH correctly to find the command)

Accepts the following environment variables:

  • PORT The tcp port to listen on. Defaults to 8080

Testing

Run go test ./src

CircleCI

For code coverage, run tests with: go test ./src -coverprofile=coverage.out Then, to view coverage report in browser, run: go tool cover -html=coverage.out

Backing Up

Copy the file from the docker host at /var/lib/docker/volumes/lucos_media_metadata_api_db/_data/media.sqlite For example: cp /var/lib/docker/volumes/lucos_media_metadata_api_db/_data/media.sqlite manual-backups/media-date +%F.sqlite

lucos_media_metadata_api's People

Contributors

lucas42 avatar dependabot[bot] avatar dependabot-preview[bot] avatar

Watchers

 avatar James Cloos avatar  avatar

lucos_media_metadata_api's Issues

Add some logging

Currently there's only logs when starting up, returning internal server errors or hitting a deprecated endpoint.
This means there's not much to go on when things aren't hitting a hard error (eg performance issues / timeouts etc)
Add some more logs covering normal operation.

Don't send updated event to loganne if nothing has changed.

At the moment, every Sunday when the lucos_media_import runs, loganne gets absolutely spammed with an event for every single track. This is unnecessary when nothing has actually changed.
Should check whether anything has changed before firing the event (perhaps even before doing a DB write if that'd be more performant?)

Why does track 2035 get played so often?

It's only got a weighting of 8, yet seems to get completely disproportionate play time. At one point I noticed it appearing 4 or 5 times in a single playlist (out of 20 or so tracks).
I know human psychology means we tend to spot patterns even in truly random data. But this one feels way beyond that level of frequency.

Delete track

Currently can't delete a track.

Probably clearest to respond to the DELETE http method for this.

Bulk Update

Create method for updating multiple tracks at once.

Include track URLs in search

Currently only tags are searched. But sometimes there's something in the url which hasn't been tagged up correctly - would be good to include that.

Tracks with missing fields

Currently if a PUT to /track/* misses a field like URL or fingerprint, the value is set to an empty string.

This should either error hard (with no modifications to the database), or succeed leaving the original value in situ.

Worth thinking about whether to treat any falsely value in the same way.

500 error when unique key conflicts

Updating a track with a URL or fingerprint which clashes with an existing one bails with a 500 and DB error.
Should handle this more gracefully.

Deleting track which is in a collection breaks stuff

Need to remove track from collection as part of delete.

Otherwise get a lot of these errors: Internal Server Error: sql: Scan error on column index 0, name "id": converting NULL to int is unsupported

(Can database be stricter around foreign keys too?)

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.