Skip to content

Commit

Permalink
Check Playlist file validity before loading using XSD.
Browse files Browse the repository at this point in the history
  • Loading branch information
itsAbhi650 committed Sep 3, 2023
1 parent b42c4f1 commit 1d52abf
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
30 changes: 30 additions & 0 deletions YAMP-alpha/PlaylistStructure.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="Windows-1252"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="YAMP_Playlist">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Music">
<xs:complexType>
<xs:sequence>
<xs:element name="File" type="xs:string" />
<xs:element name="Title" type="xs:string" />
<xs:element name="TrackNum" type="xs:string" />
<xs:element name="Album" type="xs:string" />
<xs:element name="Year" />
<xs:element name="Artist" />
<xs:element name="AlbumArtist" type="xs:string" />
<xs:element name="Composer" />
<xs:element name="Genre" type="xs:string" />
<xs:element name="DiskNumber" />
<xs:element name="Comment" />
<xs:element name="Path" type="xs:string" />
<xs:element name="Duration" type="xs:string" />
<xs:element name="BitRate" type="xs:unsignedInt" />
<xs:element name="SampleRate" type="xs:unsignedShort" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
5 changes: 5 additions & 0 deletions YAMP-alpha/bin/Debug/YAMP-alpha.exe.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
</configSections>
<appSettings>
<add key="PLSchemaFile" value="C:\Users\pc\source\repos\YAMP-alpha\PlaylistStructure.xsd"/>
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
Expand Down

0 comments on commit 1d52abf

Please sign in to comment.