OpenSubsonic: Child.sortName (fixes #135) (#197)

* OpenSubsonic: add Child.sortName from FieldKey.TITLE_SORT

Bump pom to 13.2.0-SNAPSHOT to start the 13.2.x cycle.

fixes #135

* OpenSubsonic: add Child.sortName from FieldKey.TITLE_SORT

Bump pom to 13.2.0-SNAPSHOT to start the 13.2.x cycle.

fixes #135

---------

Co-authored-by: litebito <litebito@users.noreply.github.com>
This commit is contained in:
litebito 2026-05-20 09:19:55 +02:00 committed by GitHub
parent d9fbf16d54
commit 13dc2b5bd0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 66 additions and 8 deletions

View file

@ -6,7 +6,7 @@
<parent>
<groupId>org.airsonic.player</groupId>
<artifactId>airsonic</artifactId>
<version>13.1.0</version>
<version>13.2.0-SNAPSHOT</version>
</parent>
<artifactId>airsonic-main</artifactId>

View file

@ -70,6 +70,9 @@ public class MediaFile {
@Column(name = "title", nullable = true)
private String title;
@Column(name = "sort_name", nullable = true)
private String sortName;
@Column(name = "album", nullable = true)
private String albumName;
@ -284,6 +287,14 @@ public class MediaFile {
this.title = title;
}
public String getSortName() {
return sortName;
}
public void setSortName(String sortName) {
this.sortName = sortName;
}
public String getAlbumName() {
return albumName;
}
@ -567,7 +578,7 @@ public class MediaFile {
public static final double NOT_INDEXED = -1.0;
public static final int VERSION = 4;
public static final int VERSION = 5;
public static enum MediaType {
MUSIC,

View file

@ -146,6 +146,7 @@ public class JaxbContentService {
// Ignored.
}
child.setTitle(mediaFile.getName());
child.setSortName(mediaFile.getSortName());
child.setAlbum(mediaFile.getAlbumName());
child.setArtist(mediaFile.getArtist());
child.setIsDir(mediaFile.isDirectory());

View file

@ -1014,6 +1014,7 @@ public class MediaFileService {
mediaFile.setAlbumArtist(metaData.getAlbumArtist());
mediaFile.setAlbumName(metaData.getAlbumName());
mediaFile.setTitle(metaData.getTitle());
mediaFile.setSortName(metaData.getSortName());
mediaFile.setDiscNumber(metaData.getDiscNumber());
mediaFile.setTrackNumber(metaData.getTrackNumber());
mediaFile.setGenre(metaData.getGenre());

View file

@ -88,6 +88,7 @@ public class JaudiotaggerParser extends MetaDataParser {
if (tag != null) {
metaData.setAlbumName(getTagField(tag, FieldKey.ALBUM));
metaData.setTitle(getTagField(tag, FieldKey.TITLE));
metaData.setSortName(getTagField(tag, FieldKey.TITLE_SORT));
metaData.setYear(parseIntegerPattern(getTagField(tag, FieldKey.YEAR), YEAR_NUMBER_PATTERN));
metaData.setGenre(mapGenre(getTagField(tag, FieldKey.GENRE)));
metaData.setDiscNumber(parseIntegerPattern(getTagField(tag, FieldKey.DISC_NO), null));

View file

@ -33,6 +33,7 @@ public class MetaData {
private Integer discNumber;
private Integer trackNumber;
private String title;
private String sortName;
private String artist;
private String albumArtist;
private String albumName;
@ -72,6 +73,14 @@ public class MetaData {
this.title = title;
}
public String getSortName() {
return sortName;
}
public void setSortName(String sortName) {
this.sortName = sortName;
}
public String getAlbumArtist() {
return albumArtist;
}

View file

@ -0,0 +1,17 @@
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<changeSet id="add-media-file-sort-name" author="litebito">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="media_file" columnName="sort_name" />
</not>
</preConditions>
<addColumn tableName="media_file">
<column name="sort_name" type="${varchar_type}">
<constraints nullable="true" />
</column>
</addColumn>
</changeSet>
</databaseChangeLog>

View file

@ -0,0 +1,6 @@
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<include file="add-media-file-sort-name.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>

View file

@ -23,4 +23,5 @@
<include file="11.0/changelog.xml" relativeToChangelogFile="true"/>
<include file="11.1/changelog.xml" relativeToChangelogFile="true"/>
<include file="13.1/changelog.xml" relativeToChangelogFile="true"/>
<include file="13.2/changelog.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>

View file

@ -8,7 +8,7 @@
<parent>
<groupId>org.airsonic.player</groupId>
<artifactId>airsonic</artifactId>
<version>13.1.0</version>
<version>13.2.0-SNAPSHOT</version>
</parent>
<dependencies>

View file

@ -0,0 +1,10 @@
# Airsonic-Pulse v13.2.0
## Library rescan required
* #135 introduces a `sortName` column on `media_file` populated from `FieldKey.TITLE_SORT`.
Existing rows are re-scanned automatically via the `MediaFile.VERSION` bump.
## OpenSubsonic
* #135 OpenSubsonic: Child.sortName from FieldKey.TITLE_SORT

View file

@ -5,7 +5,7 @@
<parent>
<relativePath>../../pom.xml</relativePath>
<artifactId>airsonic</artifactId>
<version>13.1.0</version>
<version>13.2.0-SNAPSHOT</version>
<groupId>org.airsonic.player</groupId>
</parent>
<packaging>pom</packaging>
@ -16,7 +16,7 @@
<dependency>
<groupId>org.airsonic.player</groupId>
<artifactId>airsonic-main</artifactId>
<version>13.1.0</version>
<version>13.2.0-SNAPSHOT</version>
<type>war</type>
</dependency>
</dependencies>

View file

@ -9,7 +9,7 @@
<parent>
<groupId>org.airsonic.player</groupId>
<artifactId>airsonic</artifactId>
<version>13.1.0</version>
<version>13.2.0-SNAPSHOT</version>
</parent>
<properties>

View file

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.airsonic.player</groupId>
<artifactId>airsonic</artifactId>
<version>13.1.0</version>
<version>13.2.0-SNAPSHOT</version>
<name>Airsonic-Pulse</name>
<packaging>pom</packaging>
<organization>

View file

@ -8,7 +8,7 @@
<parent>
<groupId>org.airsonic.player</groupId>
<artifactId>airsonic</artifactId>
<version>13.1.0</version>
<version>13.2.0-SNAPSHOT</version>
</parent>
<dependencies>

View file

@ -269,6 +269,7 @@
<xs:attribute name="displayArtist" type="xs:string" use="optional"/> <!-- Added in OpenSubsonic -->
<xs:attribute name="displayAlbumArtist" type="xs:string" use="optional"/> <!-- Added in OpenSubsonic -->
<xs:attribute name="mediaType" type="xs:string" use="optional"/> <!-- Added in OpenSubsonic -->
<xs:attribute name="sortName" type="xs:string" use="optional"/> <!-- Added in OpenSubsonic -->
</xs:complexType>
<xs:simpleType name="MediaType">