Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Infrastructure/Services/UserService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public async Task<ICollection<UserStatsDto>> GetAllUsersAsync()
DisplayName = u.DisplayName ?? u.Username,
RecentSongs = u.PlayHistories
.OrderByDescending(ph => ph.PlayedAt)
.Take(10)
.Take(20)
.Select(ph => new RecentSongDto
{
Title = ph.Song.Title,
Expand Down
82 changes: 82 additions & 0 deletions src/UI/App/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,88 @@ body {
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ===== Recently Played (expanded user row) ===== */

.table tr.recent-songs-row:hover {
background: transparent;
}

.recent-songs {
border: 1px solid rgba(255, 255, 255, 0.12);
border-radius: 0.75rem;
background: rgba(0, 0, 0, 0.15);
overflow: hidden;
}

.recent-songs-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.65rem 1rem;
font-size: 0.75rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.05em;
color: rgba(255, 255, 255, 0.6);
background: rgba(255, 255, 255, 0.06);
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.recent-songs-list {
max-height: 320px;
overflow-y: auto;
}

.recent-song-item {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.55rem 1rem;
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.recent-song-item:last-child {
border-bottom: none;
}

.recent-song-item:hover {
background: rgba(255, 255, 255, 0.05);
}

.recent-song-rank {
flex-shrink: 0;
width: 1.5rem;
text-align: right;
font-size: 0.8rem;
font-variant-numeric: tabular-nums;
color: rgba(255, 255, 255, 0.4);
}

.recent-song-title {
flex: 1;
min-width: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-weight: 500;
color: rgba(255, 255, 255, 0.9);
}

.recent-song-item .play-count {
flex-shrink: 0;
min-width: 3rem;
text-align: center;
}

.recent-song-date {
flex-shrink: 0;
width: 6.5rem;
text-align: right;
font-size: 0.8rem;
font-variant-numeric: tabular-nums;
color: rgba(255, 255, 255, 0.5);
}

/* ===== Radio Admin ===== */

.add-button {
Expand Down
55 changes: 31 additions & 24 deletions src/UI/App/src/pages/UserStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,39 +149,46 @@ export function UserStats() {
</td>
</tr>
{expandedUser === user.username && (
<tr>
<tr className="recent-songs-row">
<td colSpan={6}>
{user.recentSongs.length === 0 ? (
<span className="song-artist">
No songs played yet.
</span>
) : (
<table className="table">
<thead>
<tr>
<th>Recently Played</th>
<th>Plays</th>
<th>Last Played</th>
</tr>
</thead>
<tbody>
{user.recentSongs.map((song, songIndex) => (
<tr key={songIndex}>
<td>
<div className="song-title">
{cleanTitle(song.title)}
</div>
</td>
<td>
<div className="recent-songs">
<div className="recent-songs-header">
<span>Recently Played</span>
<span>Plays / Last Played</span>
</div>
<div className="recent-songs-list">
{user.recentSongs.map((song, songIndex) => {
const title = cleanTitle(song.title);
return (
<div
className="recent-song-item"
key={songIndex}
>
<span className="recent-song-rank">
{songIndex + 1}
</span>
<span
className="recent-song-title"
title={title}
>
{title}
</span>
<span className="play-count">
{song.totalPlays}
</span>
</td>
<td>{song.playedAt.split('T')[0]}</td>
</tr>
))}
</tbody>
</table>
<span className="recent-song-date">
{song.playedAt.split('T')[0]}
</span>
</div>
);
})}
</div>
</div>
)}
</td>
</tr>
Expand Down
Loading