GPMDP-Plugin icon indicating copy to clipboard operation
GPMDP-Plugin copied to clipboard

Cover download location shared across all measures.

Open tjhrulz opened this issue 8 years ago • 2 comments

Since the websocket is static the Cover and DefaultCover are just the ones of whatever measure was updated last.

Since Cover and Default cover need to be static in order to prevent write locking this is going to be a fun one to fix.

Update: Default cover location now is no longer unique and only Cover is. What this means for any skin user is you should never hard code the location of the cover to where you want it downloaded but instead use the path given as the string value of any Measure with the PlayerInfo of cover. Same goes for anyone using spotify. Think of CoverDownloadLocation as a suggestion of a good place to download it.

tjhrulz avatar Feb 03 '17 06:02 tjhrulz

Current potential solutions with positives and minuses are as follows:

Make websocket no longer static - This is a trash idea Make GPMDPWebsocketCreator no longer static, make defaultCoverLocation and coverOutputLocation not static, remove cover from musicInfo and have rainmeter return the internal cover variable. Then have each measure add to the OnMessage its own handle for when the track info is updated - This is better but will require each measure on reload to check if OnMessage is null if it is not then add its own OnMessage and if it is null then setup everything else, however this means that no measure that uses cover can use DynamicVariables, if they do the CPU usage will spiral out of control on every track update. Also this means I will have to check the file for write protection and will be writing the same file multiple times potentially Same thing as before but instead of each measure adding to the on message it adds to a static array of either paths or even better array of threads this is then reference that array in the onMessage and then have GetImageFromUrl go through the whole array of locations to download to - This is better yet and will prevent downloading duplicate images and then CoverWebAddress can update after the last one has downloaded (Or it can be nonstatic as well and update with each one), however I will have to worry about updating that array in a multithreaded environment. Also I am not sure but what I may have to redeclare the websockets OnMessage.

tjhrulz avatar Feb 03 '17 07:02 tjhrulz

Since I way over complicated this issue I think a much better and easier way to fix it is to instead not care about the cover location since no skin should be hard linking to it anyways and instead just fix the fact that default cover locations are shared by skins. I will still leave the issue open though until I decide if ever to make it download the cover to multiple locations.

tjhrulz avatar May 23 '17 02:05 tjhrulz