mirror of
https://github.com/misiektoja/spotify_monitor.git
synced 2026-04-25 22:55:52 +03:00
[PR #18] [MERGED] Fix truncation code to handle emojis with a actual width greater than one character. Example: 🎧 #30
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/misiektoja/spotify_monitor/pull/18
Author: @tomballgithub
Created: 7/8/2025
Status: ✅ Merged
Merged: 7/9/2025
Merged by: @misiektoja
Base:
dev← Head:truncate_fix📝 Commits (2)
ef283ceFix truncation code to handle emojis with a actual width greater than one character. Example:9aefccbInstantiate wcwidth📊 Changes
2 files changed (+17 additions, -4 deletions)
View changed files
📝
requirements.txt(+1 -0)📝
spotify_monitor.py(+16 -4)📄 Description
I noticed today that the truncation code doesn't cover the case when some emojis take up two character positions (they are double-wide). An example is the following, which was in the title of a playlist in my log: 🎧
This code does a character-by-character analysis and accounts for this.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.