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
54 changes: 54 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
root = true

[*]
charset = utf-8
end_of_line = crlf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[*.{json,yml,yaml}]
indent_size = 2

[*.{xml,xaml,csproj,props,targets}]
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[*.cs]
csharp_style_namespace_declarations = file_scoped:warning
csharp_style_expression_bodied_methods = when_on_single_line:suggestion
csharp_style_expression_bodied_properties = true:suggestion
csharp_style_expression_bodied_accessors = true:suggestion

csharp_style_var_for_built_in_types = false:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = false:suggestion

csharp_style_prefer_pattern_matching = true:suggestion
csharp_style_prefer_not_pattern = true:suggestion
csharp_style_prefer_switch_expression = true:suggestion
csharp_prefer_braces = when_multiline:suggestion

csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_space_after_keywords_in_control_flow_statements = true

dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false

dotnet_naming_rule.private_fields_underscore.symbols = private_fields
dotnet_naming_rule.private_fields_underscore.style = underscore_camel_case
dotnet_naming_rule.private_fields_underscore.severity = suggestion

dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private

dotnet_naming_style.underscore_camel_case.required_prefix = _
dotnet_naming_style.underscore_camel_case.capitalization = camel_case
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on:
push:
branches: [main, "update-*"]
pull_request:
workflow_dispatch:

jobs:
build-and-test:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Restore
run: dotnet restore

- name: Build
run: dotnet build --configuration Debug --no-restore

- name: Test
run: dotnet test --configuration Debug --no-build --verbosity normal
41 changes: 32 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,40 @@
# Sortify
Sortify reads your Spotify extended streaming history and turns it into statistics you can explore. It shows your top tracks and artists, how your listening changed over time, and how it breaks down by hour of the day and day of the week. It ships as a single portable `.exe` so there is no installation.

[![CI](https://img.shields.io/github/actions/workflow/status/IDGBAN/Sortify/ci.yml?branch=main&label=CI&logo=github)](https://github.com/IDGBAN/Sortify/actions/workflows/ci.yml)
[![Latest release](https://img.shields.io/github/v/release/IDGBAN/Sortify?label=release&color=1DB954&logo=github)](https://github.com/IDGBAN/Sortify/releases/latest)
[![Downloads](https://img.shields.io/github/downloads/IDGBAN/Sortify/total?color=1DB954&logo=github)](https://github.com/IDGBAN/Sortify/releases)
[![.NET 8](https://img.shields.io/badge/.NET-8.0-512BD4?logo=dotnet&logoColor=white)](https://dotnet.microsoft.com/download)
![Platform: Windows](https://img.shields.io/badge/platform-Windows-0078D4?logo=windows&logoColor=white)
[![License: AGPL v3](https://img.shields.io/github/license/IDGBAN/Sortify?color=663366)](LICENSE)

Sortify reads your Spotify streaming history and turns it into statistics you can explore. It shows your top tracks, artists and albums, how your listening changed over time and year by year, and how it breaks down by hour of the day and day of the week. It ships as a single portable `.exe` so there is no installation.

## Features
- Top tracks and artists, ranked by listening time, play count, or the first time you played them.
- Charts throughout the app: bar charts for top tracks and artists, a donut showing each artist's share of your listening, a line chart of listening over time, and breakdowns by hour and by day of the week.
- Sortable tables. Click any column header to reorder by that field.
- Top tracks, artists and albums, ranked by listening time, play count, or the first time you played them.
- Charts throughout the app: bar charts for top tracks, artists and albums, a donut showing each artist's share of your listening, a line chart of listening over time (daily, weekly or monthly), a day-of-week vs. hour-of-day heatmap, and breakdowns by hour and by day of the week.
- A **Years** tab with a per-year rollup: listening time, plays, unique artists and tracks, and your top artist and track for every year.
- A **Podcasts** tab covering podcasts and audiobooks: total time and plays, how many shows and episodes, top shows and top episodes, and sortable tables for both.
- Insights: longest and current listening streaks, your biggest day, listening sessions (count, average and longest), weekday vs. weekend split, favorite time of day, skip rate, most skipped tracks, a chart of new artists discovered per month, and a donut of why plays ended (finished, skipped, and so on).
- Playback context, also in Insights: your shuffle rate, how much you listened offline, and donuts breaking listening down by device (desktop, mobile, web player, speaker, car) and by country.
- Sortable tables. Click any column header to reorder by that field; right-click a row to copy it or exclude that track/artist.
- **Double-click any track, artist or album row** to open a detail view: listening time, plays, active days, first and last listen, a monthly chart, an hour-of-day profile, its tracks and albums, and a button that opens it in Spotify.
- Filters that update every chart and table as you change them:
- Minimum play duration. The default is five seconds, which drops skips.
- Whether podcasts and audiobooks count toward your track, artist and album statistics. Off by default, since a few long shows will otherwise outrank your music. The Podcasts tab shows them either way.
- Date range.
- Search by track or artist name.
- Search by track, artist or album name.
- An exclude list for specific artists or tracks.
- Time of day and day of week. Time ranges may cross midnight, for example 22:00 to 02:00.
- Export to TXT, or export tracks and artists to CSV.
- Load data your way: pick individual JSON files (Ctrl+O), point at the extracted export folder (**Open Folder**, Ctrl+Shift+O), or just drag & drop the files or the whole folder onto the window.
- Reads both the extended streaming history (`Streaming_History_Audio_*.json`) and the older account-data export (`StreamingHistory*.json`).
- Reopens the folder you used last time when it starts, and caches the parsed history so an unchanged export loads instantly instead of being re-read.
- Export to TXT (with a summary section), or export tracks, artists, albums and years to CSV.

## Get Started
1. Request your [extended streaming history](https://www.spotify.com/ca-en/account/privacy/) from Spotify. When it arrives, download and extract the ZIP.
2. Download the latest `Sortify.exe` from the [releases page](https://github.com/IDGBAN/Sortify/releases/) and run it.
3. Click **Run Analysis** and choose the JSON files you want to include.
4. Browse the Overview, Tracks, Artists, and Trends tabs, adjust the filters on the left, and export your results if you want a copy.
3. Click **Open Folder** and pick the extracted folder (or click **Run Analysis** to choose individual JSON files, or drag & drop them onto the window).
4. Browse the Overview, Tracks, Artists, Albums, Years, Podcasts, Trends and Insights tabs, adjust the filters on the left, and export your results if you want a copy.

Analysis is quick unless your history is unusually large.

Expand All @@ -32,9 +49,15 @@ dotnet publish Sortify/Sortify.csproj -c Release -r win-x64

The published `Sortify.exe` lands in `Sortify/bin/Release/net8.0-windows/win-x64/publish/`.

To run the test suite:

```bash
dotnet test
```

## Disclaimer
- Sortify is not affiliated with Spotify.
- Everything runs locally on your machine.
- Everything runs locally on your machine. The only files it writes outside your exports are a settings file and a cache of your parsed history, both in `%LOCALAPPDATA%\Sortify`; deleting that folder resets both.
- Please **review the code** before you download and run it.

## License
Expand Down
Loading
Loading