datafruits / streampusher-api Goto Github PK
View Code? Open in Web Editor NEWapi backend for streampusher
api backend for streampusher
It would also be cool to post to discord , etc.
Maybe a general 'webhook' could be added?
Can't quite reproduce this one yet, seems to be that sometimes the playlist is empty in redis, so nothing gets queued even though scheduled show # queue_playlist! was called at the correct time.
The images for scheduled shows aren't copied along to their recurrences.
Currently all of a DJs shows are returned here:
https://datafruits.streampusher.com/api/djs/m50.json?name=m50
This is extermely slow obviously.
Should we paginate this?
Should we load shows in another request entirely?
It would be great if scheduled shows have tags, so they could be displayed on the front page for upcoming shows.
Podcasts could then pull tags from the shows.
Kind of ridiculous that this isn't on JSONapi even I know...but we should really move off of it. I'm not sure how much longer active-model-adapater is going to keep working.
It would probably make things a bit easier to setup.
Currently you can only kick the current DJ with the command line.
We should add a button on this for admins.
The same button should disable the account, so they can't reconnect again.
a simple yes/no thumbsup/thumbsdown should do
backend PR: #47
frontend PR: datafruits/streampusher-frontend#76
Some show hosts should just be set to "guest" if the DJ does not have an account.
I'm not sure how this should be implemented, we could make a special user in the database, we could have a specific column on shows,
Not sure if the vcr cassettes need to be redone or something.
2) DockerWrapper creates a new docker container
Failure/Error: container = Docker::Container.get name
VCR::Errors::UnhandledHTTPRequestError:
================================================================================
An HTTP request has been made that VCR does not know how to handle:
GET http://unix/containers/coolradio_icecast/json
VCR is currently using the following cassette:
- /home/runner/work/streampusher-api/streampusher-api/spec/fixtures/vcr_cassettes/create_container.yml
- :record => :once
- :match_requests_on => [:method, :uri]
Under the current configuration VCR can not find a suitable HTTP interaction
to replay and is prevented from recording new requests. There are a few ways
you can deal with this:
I'd love if someone could just spin up a full new instance of Streampusher instantly, as a few people have asked me how to start their own online radio station.
I'm not totally sure what this will look like but I will try to think of a few steps in mind of how we could get there.
Perhaps could take some inspiration from discourse as its a pretty large open source project but installed in many places.
https://github.com/discourse/discourse/blob/master/docs/INSTALL.md
should send exceptions to discord channel #streampusher_errors , but isnt currently
It may be possible to improve this so that the live dj won't cut off the start of the scheduled show if they go over their time.
on fallback from live to scheduled show
def on_track_change(s) =
# skip the playlist back to the beginning?
source.skip(scheduled_shows)
end
!live_dj = on_track(on_track_change, !live_dj)
as some shows have multiple hosts
Once the new frontend is finished https://github.com/datafruits/frontend
Not sure but this metadata update never goes thru
dj overly sympathetic - "jeep music" ep.3 !LIVE FROM CHICAGO! - 07022023
This might make things easier on the admin side of things.
We could just mark the shows as 'inactive' as well.
Create a script that installs docker and sets up the app on a new server.
Seek compatibility with fresh digital ocean or linode image.
We may need to upgrade incrementally to rails 5.2, then 6.
I get an error when I run the script needed to get the docker container running with rails, postgres, redis, and sidekiq:
./script/setup
the script seems works fine in installing gems and setting up Redis. however, when it gets to the step to create the postgres db I get the following error (which is a super common error with rails/postgres judging from all the stack overflow articles):
could not connect to server: Connection refused
Is the server running on host "postgres" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
Couldn't create database for {"adapter"=>"postgresql", "database"=>"stream_pusher_dev", "pool"=>5, "timeout"=>5000, "username"=>"postgres", "password"=>"postgres", "host"=>"postgres", "port"=>5432}
rake aborted!
PG::ConnectionBad: could not connect to server: Connection refused
Is the server running on host "postgres" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
this is either a problem with my local environment/docker version/setup or there is a something wrong with the rails/postgres config/volumes, as defined in docker-compose-dev.yml
:
postgres:
image: "postgres:9.4"
ports:
- 5432
volumes:
- postgres_data_9.4:/var/lib/postgresql/data
rails:
image: "streampusher/streampusher:latest"
user: rails
working_dir: /home/rails/app
command: ./script/rails
env_file: .env
environment: &shared_env
POSTGRESQL_HOST: postgres
POSTGRESQL_PORT: 5432
POSTGRESQL_USERNAME: postgres
REDIS_HOST: redis
depends_on:
- postgres
- redis
...
volumes:
postgres_data_9.4:
Fix this failing spec and get it to pass on CI.
rspec ./spec/models/track_spec.rb:39 # Track scheduled show pulls tags and artwork from scheduled show if not set
I think the issue is the hash in the URL for the filename is different each time, so the VCR cassette never matches.
1) Track scheduled show pulls tags and artwork from scheduled show if not set
Failure/Error: track.save
VCR::Errors::UnhandledHTTPRequestError:
================================================================================
An HTTP request has been made that VCR does not know how to handle:
PUT https://streampushertest.s3.amazonaws.com/artworks/original/_hey-hey-06292021__e6a1282fa3b54d888e27bbd74d845f1a4504ce4396505d2b846b37d9e12c03cc.png
v```
Someone who knows VCR well should know how to solve this one.
This spec fails when running in CI.
./spec/models/playlist_spec.rb:24 # Playlist sets another playlist to default if default is being destroyed
When I run the single spec file, the test seems to pass though.
There must be some issue with some db state not getting reset properly in the test suite, I'm guessing.
This issue is to fix this spec and make it pass reliably in CI.
Tracks have a length column that should be filled with the length in seconds after the tags processing background job completes, but lately I don't see any populated length columns.
The test suite is not passing currently.
We don't need to fix any acceptance tests as the app will be converted to an API only app soon.
We should fix any model, service, and controller tests.
We also need to get the suite running on github actions for CI. It's running on github actions now ,here is a recent run (failing)
https://github.com/datafruits/streampusher-api/runs/2128500254?check_suite_focus=true
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.