Modernflyouts: Cannot connect to Spotify

Created on 9 Oct 2020  Β·  15Comments  Β·  Source: ModernFlyouts-Community/ModernFlyouts

The media flyout cannot connect to the uwp version of Spotify , the media info is wrong and cannot adjust the progress bar.

Bug Enhancement Good First Issue Known issue

Most helpful comment

@ShankarBUS, thanks, and I understand that it may be unnecessary in this case - Windows has basically one executable extension, almost all programs use it (there are some very rare exceptions when executable might have another extension) and I don't think this program would be ported to Linux/other OS, so it should be good πŸ‘

All 15 comments

Please see issue #29

Do you mean the store version of Spotify?

By progress bar do you mean the volume control or the timeline infos?

The timeline info only shows the progress, seeking the time is currently not implemented.

Part of this issue belongs to #29 and other to #93

We're working on it and will fix these issues ASAP

@Samuel12321 Should this issue be made into a feature proposal - (Add support for seeking or changing the progress of the media playback)?

Thanks @Cyberdroid1 πŸ€—

We can make it a feature proposal, at the moment it would be super low priority

Woah!

Made some slight changes and got some great improvements!

Spotify shows the icon and name now, clicking on them opens Spotify!

Spotify now completely compatible with ModernFlyouts (shuffle, repeat, stop & timeline infos.. all of them are working!)

image
image

They should have updated the app. Anyway, we still have #29. #93 is being worked on.

brilliant

Well I didn't do anything πŸ€·β€β™‚οΈ. They must have added the SMTC support themselves.

This is how it previously was

image

Credits - @Dubzer in #6

I had a shitty method to find the process name from the app id. That's what caused spotify's icon and name to be invisible.
var processName = AppId.Remove(AppId.Length - 5, 4);

This method returns Spotife when the app id is Spotify.exe (It removed "y.ex" instead of ".exe". Thus, ModernFlyouts couldn't fetch the name and icon of the app πŸ€¦β€β™‚οΈ).

But it worked for MS Edge & Chrome without any problems because it will return msedge because msedge.exe has "e" at the end and before the '.'

Changing it to "4" fixed the issue.

- var processName = AppId.Remove(AppId.Length - 5, 4);
+ var processName = AppId.Remove(AppId.Length - 4, 4);

Sorry for this silly mistake πŸ˜…

Seems to be done

Changing it to "4" fixed the issue.

- var processName = AppId.Remove(AppId.Length - 5, 4);
+ var processName = AppId.Remove(AppId.Length - 4, 4);

Isn't it would be easier to just use?..
var processName = AppId[..^4];

var processName = AppId[..^4];

What in the tarnation is this syntax?

Is this even C#?

JK, take a look at this

https://github.com/ShankarBUS/ModernFlyouts/issues/93#issuecomment-707484567

Is the new approach correct atleast?

This is the range feature which was introduced in C# 8.0

image

@Dubzer, woah!

That's cool. Forgot that this thing even existed πŸ€¦β€β™‚οΈ. My mind is stuck with C# 6 πŸ€¦β€β™‚οΈ. Read that thing in the C# 8 blog post. But wasn't sure where to implement this πŸ˜….

I will update this immediately. It looks cool.

This is the range feature which was introduced in C# 8.0

image

To be honest, this is not the correct approach, since we rely on the length of the extension, when we shouldn't care about it at all. I think it's possible to use Path.GetFileNameWithoutExtension in this case.

@Vital7,

I know another method that'll split the string with '.' as the delimiter, omit the final slice and return the process' name just the like method you suggested.

What you suggested is absolutely great!

But that would be unnecessary.

The length of the extension will never change. It will always be ".exe" (4 characters). So no problems with his approach✌️.

@ShankarBUS, thanks, and I understand that it may be unnecessary in this case - Windows has basically one executable extension, almost all programs use it (there are some very rare exceptions when executable might have another extension) and I don't think this program would be ported to Linux/other OS, so it should be good πŸ‘

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Poopooracoocoo picture Poopooracoocoo  Β·  4Comments

toineenzo picture toineenzo  Β·  4Comments

Cyberdroid1 picture Cyberdroid1  Β·  4Comments

privacyguy123 picture privacyguy123  Β·  3Comments

DanRotaru picture DanRotaru  Β·  3Comments