Giter VIP home page Giter VIP logo

wavebox's People

Contributors

einsteinx2 avatar justindhill avatar mdlayher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

wavebox's Issues

Art in multi-disc albums updates on each restart

Noticed this a few times, and Justin has confirmed that it's probably an issue. I have a few albums which are multiple disc, with each disc residing in its own folder, and usually with its own folder.jpg.

This appears to be confusing WaveBox, as it updates the art on each restart for these albums. I suspect it is reading Disc 1 art, then overwriting it with Disc 2, then on restart, overwriting with Disc 1 again, etc.

Here's an example: (these are still Console.WriteLine for now, that should probably be changed too)

There was an old art id
Art needs updating: /srv/media/Music/FLAC/Breaking Benjamin/2006 - Phobia/Folder.jpg
There was an old art id
Art needs updating: /srv/media/Music/FLAC/Dethklok/2007 - The Dethalbum (bonus disc)/folder.jpg
There was an old art id
Art needs updating: /srv/media/Music/FLAC/Led Zeppelin/2007 - Mothership/Disc 2/folder.jpg
There was an old art id
Art needs updating: /srv/media/Music/FLAC/Parov Stelar/2009 - Coco/Disc 2/folder.jpg
There was an old art id
Art needs updating: /srv/media/Music/FLAC/Parov Stelar/2009 - Coco/folder.jpg
There was an old art id
Art needs updating: /srv/media/Music/FLAC/Red Hot Chili Peppers/2006 - Stadium Arcadium/Mars (Disc 2)/folder.jpg
There was an old art id
Art needs updating: /srv/media/Music/FLAC/Red Hot Chili Peppers/2006 - Stadium Arcadium/folder.jpg
There was an old art id
Art needs updating: /srv/media/Music/FLAC/Silversun Pickups/2006 - Carnavas/folder.jpg

Clean up ApiHandlers and HttpProcessor classes

While making modifications today, I noticed some places where we have duplicate code, etc, that should be refactored to common places to prevent bugs in the future where we change it in one place but not another.

Also, the method signatures in HttpProcessor are getting pretty long, so that should probably be refactored now that it has all of the range, etc support that it needs and we won't likely be changing it further.

48bpp PNGs not supported in cover art

Guess we should look into an image solution other than GDI+.

[HTTPSERVER] POST request: /api/cover/420?v=1&c=iSub&u=test&p=test&size=120

** (process:38658): WARNING **: PNG images with 48bpp aren't supported by libgdiplus.
[HTTPSERVER(1)] System.ArgumentException: A null reference or invalid value was found [GDI+ status: InvalidParameter]
  at System.Drawing.GDIPlus.CheckStatus (Status status) [0x0009d] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs:220 
  at System.Drawing.Image.get_Width () [0x0000e] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.Drawing/System.Drawing/Image.cs:770 
  at (wrapper remoting-invoke-with-check) System.Drawing.Image:get_Width ()
  at WaveBox.ApiHandler.Handlers.CoverArtApiHandler.ResizeImage (System.Drawing.Image imgToResize, Size size) [0x00000] in /Users/justin/Development/WaveBox/WaveBox/src/ApiHandler/Handlers/CoverArtApiHandler.cs:153 
  at WaveBox.ApiHandler.Handlers.CoverArtApiHandler.Process () [0x001e1] in /Users/justin/Development/WaveBox/WaveBox/src/ApiHandler/Handlers/CoverArtApiHandler.cs:96 
  at WaveBox.Http.HttpProcessor.HandlePOSTRequest () [0x000fe] in /Users/justin/Development/WaveBox/WaveBox/src/HttpServer/HttpProcessor.cs:218 
  at WaveBox.Http.HttpProcessor.process () [0x00072] in /Users/justin/Development/WaveBox/WaveBox/src/HttpServer/HttpProcessor.cs:77 

WaveBox doesn't index release dates on albums

Realized today as I was working on MPD stuff that the "ReleaseYear" field is never populated. Justin tells me it was sort of forgotten about.

It is currently set as an int, but never populated. My thought would be to handle it as a string and call it good, because the standard field "Date" could be anything like 2013, 2013-03-05, etc.

WaveBox auto-tagging feature

Saw this in the code for Album.cs:

// TO DO
public void AutoTag()
{
}

I take it this means that WaveBox will eventually have some kind of album lookup functionality, which can retag files on the fly? If so, just wanted to put this on the issue tracker so that a proper milestone may be set.

Add API call to manage registered devices/sessions

Add API to manage and display active user sessions. This would allow for the web interface to have a page for deactivating associated devices and active sessions. Otherwise, sessions live forever or until a user's password is changed.

Unit Tests

Along the same lines as the deprecated branches, will we bother implementing unit tests to WaveBox, now that so much functionality already exists? I'm not saying it's a good or bad idea either way, but I am just curious if they're worth the effort now.

Add auto-update ability for all platforms

We looked into possible solutions, and it looks like a home built one is going to be best. The basic idea is as follows:

All platforms:

WaveBox core checks for updates from our server periodically. When an update is available, this data is saved. The update alert is shown to users in web/mobile clients.

Windows and Mac:

When a user selects to update, WaveBox downloads the installer file and runs it. User must follow the prompts to complete install.

Linux:

When user selects to update, they are directed to the download page for installers so they can choose the best one for their system.


In the future:

In place auto-updating with no user interaction.

Crash reporting opt-out

I really like the automated crash reporting, but there will always be users who are paranoid enough to believe that it provides an avenue to breach their privacy, etc. Should there be an opt-out setting, though it is strongly recommended to leave it enabled?

If you'd like, I can write that very quickly.

libbass not working on Linux (X-Server required. Check your DISPLAY environment variable)

I just fixed the DLL map for libbass, but I am now encountering the following while trying to use it to play back a song.

Why in the world would I need an X server to play back music? Any ideas?

2013-05-15 18:01:10,973 INFO WaveBox.Singletons.Jukebox [0] - Playing song: 02 - Peace Of Mind.flac
2013-05-15 18:01:10,973 INFO WaveBox.Singletons.Jukebox [0] - Setting up BASS
2013-05-15 18:01:10,977 INFO WaveBox.Singletons.Jukebox [0] - BASS buffer size: 500ms
2013-05-15 18:01:11,033 INFO WaveBox.Singletons.Jukebox [0] - Re-initializing BASS

Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.WindowsFormsSynchronizationContext ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.XplatUI ---> System.ArgumentNullException: Could not open display (X-Server required. Check you DISPLAY environment variable)
Parameter name: Display
  at System.Windows.Forms.XplatUIX11.SetDisplay (IntPtr display_handle) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.XplatUIX11..ctor () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.XplatUIX11.GetInstance () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.XplatUI..cctor () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Windows.Forms.Theme.get_MenuAccessKeysUnderlined () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.SystemInformation.get_MenuAccessKeysUnderlined () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control..ctor () [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:.ctor ()
  at System.Windows.Forms.WindowsFormsSynchronizationContext..cctor () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Windows.Forms.Control..ctor () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.ScrollableControl..ctor () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.ContainerControl..ctor () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Form..ctor () [0x00000] in <filename unknown>:0
  at Un4seen.Bass.a..ctor (Boolean A_0, Int32 A_1) [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) Un4seen.Bass.a:.ctor (bool,int)
  at Un4seen.Bass.Bass.a (System.Object A_0) [0x00000] in <filename unknown>:0

Investigate stream synchronization via RTP

I've found a library for .NET which implements the Real-time Transport Protocol, or RTP. RTP seems to be a perfect candidate for use with synchronizing a WaveBox audio stream between multiple machines. This could create a "WavePool" configuration, between a master WaveBox and smaller "PuddleBoxes" or similar. (catchy terms Justin and I coined earlier, haha)

Once I'm done with school and such, I'd be happy to look into implementing some of this!

http://conferencexp.codeplex.com/

WaveBox potential memory leak in HttpServer/HttpProcessor

Working with Justin today, I tried bombarding WaveBox with continuous requests for /api/albums, and was able to crash WaveBox with the following errors. Justin believes that sockets are being left open, potentially causing a memory leak or a crash when too many requests are received.

Will investigate further as time permits.

2012-12-08 14:25:37.5746|INFO|WaveBox.ApiHandler.ApiHandlerFactory|[ApiHandlerFactory] uri: /api/albums?s=BF1D9666C9CEE53DA1AADC4E222D12737DAA1AA5
2012-12-08 14:25:37.5971|ERROR|WaveBox.ApiHandler.Handlers.AlbumsApiHandler|[ALBUMSAPI(1)] ERROR: System.IO.IOException: Write failure ---> System.Net.Sockets.SocketException: The socket has been shut down
  at System.Net.Sockets.Socket.Send (System.Byte[] buf, Int32 offset, Int32 size, SocketFlags flags) [0x00000] in <filename unknown>:0
  at System.Net.Sockets.NetworkStream.Write (System.Byte[] buffer, Int32 offset, Int32 size) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Net.Sockets.NetworkStream.Write (System.Byte[] buffer, Int32 offset, Int32 size) [0x00000] in <filename unknown>:0
  at System.IO.BufferedStream.Flush () [0x00000] in <filename unknown>:0
  at System.IO.BufferedStream.Write (System.Byte[] array, Int32 offset, Int32 count) [0x00000] in <filename unknown>:0
  at System.IO.StreamWriter.FlushBytes () [0x00000] in <filename unknown>:0
  at System.IO.StreamWriter.Decode () [0x00000] in <filename unknown>:0
  at System.IO.StreamWriter.LowLevelWrite (System.String s) [0x00000] in <filename unknown>:0
  at System.IO.StreamWriter.Write (System.String value) [0x00000] in <filename unknown>:0
  at WaveBox.Http.HttpProcessor.WriteText (System.String text, System.String mimeType) [0x00000] in <filename unknown>:0
  at WaveBox.Http.HttpProcessor.WriteJson (System.String json) [0x00000] in <filename unknown>:0
  at WaveBox.ApiHandler.Handlers.AlbumsApiHandler.Process () [0x00000] in <filename unknown>:0

Unhandled Exception: System.Net.Sockets.SocketException: Too many open files
  at System.Net.Sockets.Socket.Accept () [0x00000] in <filename unknown>:0
  at System.Net.Sockets.TcpListener.AcceptTcpClient () [0x00000] in <filename unknown>:0
  at WaveBox.Http.HttpServer.Listen () [0x00000] in <filename unknown>:0
  at System.Threading.Thread.StartInternal () [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.Net.Sockets.SocketException: Too many open files
  at System.Net.Sockets.Socket.Accept () [0x00000] in <filename unknown>:0
  at System.Net.Sockets.TcpListener.AcceptTcpClient () [0x00000] in <filename unknown>:0
  at WaveBox.Http.HttpServer.Listen () [0x00000] in <filename unknown>:0
  at System.Threading.Thread.StartInternal () [0x00000] in <filename unknown>:0

Folder art not added any time after the initial scan

Folder art is never added after a file system event or during a FolderScanOperation subsequent to the first one. The FolderScanOperation should check to see if a folder has art in the database during a re-scan, and if not, check to see if there is a picture file in the actual folder.

WaveBox DLNA server

I'm going to start another experimental branch to try and bring DLNA functionality to WaveBox, using Mono.Upnp. The end goal will be that a novice user could install WaveBox, point it at their media, and fire up their PS3/Xbox 360/other set-top box and enjoy dead-easy and preconfigured streaming.

This will definitely be a Release 2.x feature. I'm going to try to add it as another AbstractTcpServer component, for easy interoperability with current systems.

WaveBox Jukebox with MPD compatibility layer

I had the idea earlier today of creating a MPD-compatible server within WaveBox, so that we can control a Jukebox in future releases using a MPD-compatible client. I've already made a bit of progress, but I understand that the Jukebox may not make it into the first release.

Here's a quick summary of what I've worked on:

  • Created AbstractTcpServer, from which the current HttpServer and the new MpdServer inherit
  • WaveBoxMain: created generic "StartTcpServer" method which can launch any AbstractTcpServer derivatives
  • Settings: changed "port" to "httpPort" and added "mpdPort"

If the Jukebox is delayed, I'll keep working on this stuff regardless, but so far, so good. I don't expect this to make it into the first release, but I'm willing to put in some time and effort to make it happen.

Continuing on from Ben's comment in the other thread:

MPD is open-source and widely-used, and many front-ends already exist. By implementing a MPD-compatibility layer to communicate with the WaveBox jukebox, we are able to utilize a variety of pre-existing clients to : http://mpd.wikia.com/wiki/Clients

Because the MPD protocol is used for remote-control of a "jukebox" device, it seems like a natural complement to the built-in Jukebox; especially because so many clients already exist. The protocol is simple enough to implement, and I could probably have it up and running in a few days, assuming the Jukebox works!

As far as simultaneous streaming goes, we could look into something like an Icecast-compatible API handler, or your current idea, Ben. I was playing with RTP for a bit, and perhaps that could be chained into the Jukebox output as well, but that's still a bit of a ways off.

WaveBox does not properly terminate HttpServer on exit

WaveBox is not terminating the HttpServer properly on exit, causing it to hang. The issue lies within WaveBox/src/HttpServer/HttpServer.cs. Either the TcpListener or Thread are hanging here.

A potential solution could be to use Listener.Pending() to determine if a connection is pending, before using the TcpListener to listen, but I have not had any success implementing this properly yet.

Refactor data model static methods into repository classes

In beginning to implement Ninject, I'm realizing that we made a poor design choice by having static methods all over the place as they can't access the injected properties. Also it's difficult/impossible to write unit tests when we're accessing static methods everywhere.

What we need to do is refactor all of the data model classes to remove all of the static database access methods from them into non-static repository classes (so for instance Artist would have ArtistRepository that would have all of the lookup methods, and any instance methods in Artist that return data would call a method on ArtistRepository and pass themselves as a parameter). The repository classes would be singletons not in implementation but by the way they are registered with Ninject, so the end effect is the same as having static methods but it allows us to inject objects and write tests.

Since this will take some significant refactoring time (likely a couple of days of all day work), I'm holding off on this for now and am using the "resource locator" (anti-)pattern (that we're already using all over) to directly access the Ninject kernel object wherever I need to remove functionality from Core to satisfy the PCL requirements. But when there is free time, I'll tackle this.

HTTP last-modified header on album art

Even though this value will never be changing, it's crucial to have this header, because it signals to browsers that the content is cacheable. Definitely want to cache album art in browsers.

Audio transcoding

Finish audio only transcoding to MP3 and potentially other formats. (does not include HLS)

Update API documentation

I spent a while this morning working on the API documentation on Google Drive, and managed to clean up and update Login through Genres API handlers.

Will keep working on it, to make sure the documentation is fully up to date come release time. If anyone sees any problems or errors with my documentation, feel free to make corrections!

Exceptions and logging

Being that a public beta is coming up pretty quick, I think it may be a good idea to begin making use of more log levels than just "Info" and "Error".

For example, I just found scanned folder which my current UNIX user does not have permission to access. The current log output would be as follows:

Code:

logger.Error("\t" + "[FOLDERSCAN(9)] \"" + folderPath + "\" : Access denied. " + e);

Output:

2013-05-13 12:37:56,833 ERROR WaveBox.FolderScanning.FolderScanOperation [0] -  [FOLDERSCAN(9)] "/mnt/temp/lost+found" : Access denied. System.UnauthorizedAccessException: Access to the path "/mnt/temp/lost+found" is denied.
  at System.IO.Directory.GetFileSystemEntries (System.String path, System.String searchPattern, FileAttributes mask, FileAttributes attrs) [0x00000] in <filename unknown>:0
  at System.IO.Directory.GetDirectories (System.String path, System.String searchPattern) [0x00000] in <filename unknown>:0
  at System.IO.Directory.GetDirectories (System.String path) [0x00000] in <filename unknown>:0
  at WaveBox.FolderScanning.FolderScanOperation.ProcessFolder (System.String folderPath) [0x00000] in <filename unknown>:0

I think it may be a good idea to start putting exception output in the Debug log level, so we can instead do the following:

Code:

logger.Error("\t" + "[FOLDERSCAN(9)] \"" + folderPath + "\" : Access denied.");                                                     
logger.Debug("\t" + e);

Output (log level "INFO"):

2013-05-13 12:39:50,213 ERROR WaveBox.FolderScanning.FolderScanOperation [0] -  [FOLDERSCAN(9)] "/mnt/temp/lost+found" : Access denied.

This way, when we have log level Debug enabled (during development), we can see the exceptions, but users won't have to, and they won't clutter up logs with garbage.

Thoughts?

Add API call to download media database

First we need to move the user and session tables into a separate DB, then add an API call to download the entire sqlite db file.

We'll also need a way for the status call to send the last db update time, so the app knows when to pull down a new one.

And eventually we need to have a way to pull deltas (potential simple way would be to keep a log of each query ran with timestamps, kind of like a mysql bin log, so the client can just replay events).

Function to create temporary test account

In the native settings panel, as well as potentially in the web client settings area, have a button to create a temporary test account that is active for 24 hours or something like that. Would make helping users much easier, rather than having them make an account, delete it, etc. They just hit a button and it shows the exactly what login details to email.

Add API call for updating stats

Add API call for updating stats of a song, album, or artist such as play count. Perhaps more depending on how creative we want to get.

ZeroConf functionality

Just realized, I don't think I have ever seen this working. Does it work, and if not, should it be ready for beta?

Don't return db heavy stats from the status API call by default

The status API call needs to be separated into "basic" and "extended" info. Where basic is returned by default, and extended only included when specifically asked for. That way we can keep all kinds of info in the extended response, but keep the status call quick for frequent use by clients.

Also if possible, we should cache the values once they've been read until the db is modified again.

Folders model constraint violation exceptions

Trace:

2013-06-14 13:03:40,171 ERROR WaveBox.Model.Folder [0] - System.Data.SQLite.SQLiteException: Abort due to constraint violation
columns folder_name, folder_path are not unique
  at System.Data.SQLite.SQLite3.Reset (System.Data.SQLite.SQLiteStatement stmt) [0x00000] in <filename unknown>:0
  at System.Data.SQLite.SQLite3.Step (System.Data.SQLite.SQLiteStatement stmt) [0x00000] in <filename unknown>:0
  at System.Data.SQLite.SQLiteDataReader.NextResult () [0x00000] in <filename unknown>:0
  at System.Data.SQLite.SQLiteDataReader..ctor (System.Data.SQLite.SQLiteCommand cmd, CommandBehavior behave) [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.Data.SQLite.SQLiteDataReader:.ctor (System.Data.SQLite.SQLiteCommand,System.Data.CommandBehavior)
  at System.Data.SQLite.SQLiteCommand.ExecuteReader (CommandBehavior behavior) [0x00000] in <filename unknown>:0
  at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery () [0x00000] in <filename unknown>:0
  at WaveBox.Static.Database.ExecuteNonQueryLogged (IDbCommand command) [0x00000] in <filename unknown>:0
  at WaveBox.Model.Folder.InsertFolder (Boolean isMediaFolder) [0x00000] in <filename unknown>:0

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.