Compare commits

...

9 Commits
1.3.0 ... 1.3.3

Author SHA1 Message Date
Matt Nadareski
432ce85f89 Bump version 2024-03-05 11:16:22 -05:00
Matt Nadareski
438e8067eb Update SabreTools.IO 2024-03-05 11:12:59 -05:00
Matt Nadareski
9715507aaf Add nuget package and PR workflows 2024-02-27 19:17:20 -05:00
Matt Nadareski
b745d4b9f6 Update copyright year 2024-01-30 13:39:23 -05:00
Matt Nadareski
4271bd86b3 Bump version 2024-01-26 09:57:09 -05:00
Matt Nadareski
88de4be27b Fix too-long string values 2024-01-26 01:23:33 -05:00
Matt Nadareski
33905165f7 Bump version 2024-01-05 21:57:50 -05:00
Deterous
83ec3b6950 Update CueSheet.Deserializer.cs (#2)
* Update CueSheet.Deserializer.cs

Don't return null when cuesheet is not ended

* Explicitly deal with new track/file cases
2024-01-02 17:51:27 -08:00
Matt Nadareski
9b5d51884c Use more lenient file reading 2023-12-13 15:45:40 -05:00
6 changed files with 81 additions and 6 deletions

43
.github/workflows/build_nupkg.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: Nuget Pack
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Pack
run: dotnet pack
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: 'Nuget Package'
path: 'bin/Release/*.nupkg'
- name: Upload to rolling
uses: ncipollo/release-action@v1.14.0
with:
allowUpdates: True
artifacts: 'bin/Release/*.nupkg'
body: 'Last built commit: ${{ github.sha }}'
name: 'Rolling Release'
prerelease: True
replacesArtifacts: True
tag: "rolling"
updateOnlyUnreleased: True

17
.github/workflows/check_pr.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
name: Build PR
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Build
run: dotnet build

View File

@@ -1280,6 +1280,7 @@ namespace SabreTools.Serialization
{
var stringData = new StringData();
int dataStartOffset = offset;
stringData.Length = data.ReadUInt16(ref offset);
stringData.ValueLength = data.ReadUInt16(ref offset);
stringData.ResourceType = (VersionResourceType)data.ReadUInt16(ref offset);
@@ -1294,7 +1295,8 @@ namespace SabreTools.Serialization
if (stringData.ValueLength > 0)
{
byte[]? valueBytes = data.ReadBytes(ref offset, stringData.ValueLength * sizeof(ushort));
int bytesReadable = Math.Min(stringData.ValueLength * sizeof(ushort), stringData.Length - (offset - dataStartOffset));
byte[]? valueBytes = data.ReadBytes(ref offset, bytesReadable);
if (valueBytes != null)
stringData.Value = Encoding.Unicode.GetString(valueBytes);
}

View File

@@ -165,6 +165,12 @@ namespace SabreTools.Serialization.Files
cueTracks.Add(track);
break;
// Next file found, return
case "FILE":
i--;
cueFile.Tracks = cueTracks.ToArray();
return cueFile;
// Default means return
default:
i--;
@@ -299,6 +305,13 @@ namespace SabreTools.Serialization.Files
cueTrack.PostGap = postgap;
break;
// Next track or file found, return
case "TRACK":
case "FILE":
i--;
cueTrack.Indices = cueIndices.ToArray();
return cueTrack;
// Default means return
default:
i--;
@@ -583,4 +596,4 @@ namespace SabreTools.Serialization.Files
#endregion
}
}
}

View File

@@ -20,7 +20,7 @@ namespace SabreTools.Serialization
return null;
// Open the file for deserialization
var stream = File.OpenRead(path);
var stream = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
// Get the extension to determine if additional handling is needed
string ext = Path.GetExtension(path).TrimStart('.');

View File

@@ -8,12 +8,12 @@
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>1.3.0</Version>
<Version>1.3.3</Version>
<!-- Package Properties -->
<Authors>Matt Nadareski</Authors>
<Description>Serialization and deserialization helpers for various types</Description>
<Copyright>Copyright (c) Matt Nadareski 2019-2023</Copyright>
<Copyright>Copyright (c) Matt Nadareski 2019-2024</Copyright>
<PackageProjectUrl>https://github.com/SabreTools/</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/SabreTools/SabreTools.Serialization</RepositoryUrl>
@@ -27,7 +27,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="SabreTools.IO" Version="1.3.0" />
<PackageReference Include="SabreTools.IO" Version="1.3.1" />
<PackageReference Include="SabreTools.Models" Version="1.3.0" />
</ItemGroup>