Giter Club home page Giter Club logo

Comments (11)

XalaTheShepard avatar XalaTheShepard commented on July 23, 2024 1

I overlooked that one. Will tell you in an hour or two

from ytube_music_player.

teo-luc avatar teo-luc commented on July 23, 2024

I just fixed it by myself by safely accessing the HashMap
Please help me update your code if it's needed. Thanks

	async def _tracks_to_attribute(self):
		self.log_debug_later("[S] _tracks_to_attribute")
		await self.async_update_extra_sensor('total_tracks', len(self._tracks))
		track_attributes = []
		for track in self._tracks:
			info = self.extract_info(track)
			artistInfo = info['track_artist']
			# safely checking the artistInfo
			if artistInfo is None:
				artistInfo = ""
			# safely checking the trackNameInfo
			trackNameInfo = info['track_name']
			if trackNameInfo is None:
				trackNameInfo = ""
			track_attributes.append(artistInfo + " - " + artistInfo)
		await self.async_update_extra_sensor('tracks', track_attributes)  # update extra sensor
		
		# fire event to let media card know to update
		event_data = {
			"device_id": self._attr_unique_id,
			"entity_id": self.entity_id,
			"type": "reload_playlist",
		}
		self.hass.bus.async_fire(DOMAIN+"_event", event_data)
		self.log_me('debug', "[E] _tracks_to_attribute")

from ytube_music_player.

XalaTheShepard avatar XalaTheShepard commented on July 23, 2024

I was about to report the same issue.
Will it be solved with an update or do we manually repair it?

from ytube_music_player.

KoljaWindeler avatar KoljaWindeler commented on July 23, 2024

@teo-luc you are most welcome to submit a pull request.
But I can copy you fix as well .. let me know

from ytube_music_player.

teo-luc avatar teo-luc commented on July 23, 2024

Hi @KoljaWindeler I get an issue while pushing the change.

Pushing to github.com:KoljaWindeler/ytube_music_player.git
ERROR: Permission to KoljaWindeler/ytube_music_player.git denied to teo-luc.

so please help me to update the change by following my fix here.

Thanks a lot πŸ™Œ

from ytube_music_player.

XalaTheShepard avatar XalaTheShepard commented on July 23, 2024

Dear KoljaWindeler,

Could you please push this solved issue as a new update to the custom component?
This would prevent the users from downgrading to the May update again.

Many thanks in advance.

Kind regards,

Robin

from ytube_music_player.

KoljaWindeler avatar KoljaWindeler commented on July 23, 2024

hey guys, can you help me to reproduce this bug? what have you done to trigger it?

Your fix might solve it, but it is strange that it is needed in the first place. We're running extract_info to get the data here

which is setting all the attributes in the first lines

so why is this happening?

from ytube_music_player.

XalaTheShepard avatar XalaTheShepard commented on July 23, 2024

Dear KoljaWindeler,

Nothing out of the ordinary is used to recreate this bug.
I just updated from the May update (previous one) to this one.
When trying to start a playlist after the update, using the input select entities, we got this error message and nothing was able to play.

Downgrading to the May update solved the issue. But upgrading again to the latest stable release causes this issue to appear again

from ytube_music_player.

KoljaWindeler avatar KoljaWindeler commented on July 23, 2024

Even with the latest release that I've uploaded yesterday?

from ytube_music_player.

XalaTheShepard avatar XalaTheShepard commented on July 23, 2024

I just have tested the latest update. The issue is no longer, but I noticed the shuffle playmode no longer works. Or it was just bad luck it started twice with the very first song of the playlist.

from ytube_music_player.

KoljaWindeler avatar KoljaWindeler commented on July 23, 2024

still strange that I can't reproduce it .. but alright .. the random was indeed changed / fixed.
The previous version was ALWAYS shuffeling the playlist. The code looked at the dropdown and used that shuffle or random mechanism. This was a problem for me, because my kids listen to audiobooks. The fix is that the code only looks at the shuffle/random mode if "shuffle" is active.

you can:

  • click on the shuffle button of e.g. mini-media-player before starting your playlist (should be persistent until reboot)
  • run the service: media_player.shuffle_set after reboot
  • go the the advance configuration and check this
  • image

or maybe you have all that and just had some luck :)

from ytube_music_player.

Related Issues (20)

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.