GithubHelp home page GithubHelp logo

Comments (2)

c72578 avatar c72578 commented on July 24, 2024

Thanks for this bug report.
The current behavior is coming from here:

string dataTrackInfo = !entry.toc[entry.toc.TrackCount].IsAudio && this.toc[this.toc.TrackCount].IsAudio ?

The info CD-Extra data track length ... is currently only written to the *.accurip file under above described circumstances, if the entry in the database has a data track at the end and the ripped CD has an audio track as the last track (no data track). Relevant code:

!entry.toc[entry.toc.TrackCount].IsAudio && this.toc[this.toc.TrackCount].IsAudio

So, this.toc[this.toc.TrackCount].IsAudio needs to be removed, that the info CD-Extra data track length ... is also written, if the last track of the ripped CD is a data track.

Suggested update:

diff --git a/CUETools.CTDB/CUEToolsDB.cs b/CUETools.CTDB/CUEToolsDB.cs
index b74a8ca..88619e8 100644
--- a/CUETools.CTDB/CUEToolsDB.cs
+++ b/CUETools.CTDB/CUEToolsDB.cs
@@ -603,7 +603,7 @@ namespace CUETools.CTDB
                     string confFormat = (this.Total < 10) ? "{0:0}/{1:0}" :
                         (this.Total < 100) ? "{0:00}/{1:00}" : "{0:000}/{1:000}";
                     string conf = string.Format(confFormat, entry.conf, this.Total);
-                    string dataTrackInfo = !entry.toc[entry.toc.TrackCount].IsAudio && this.toc[this.toc.TrackCount].IsAudio ?
+                    string dataTrackInfo = !entry.toc[entry.toc.TrackCount].IsAudio ?
                         string.Format("CD-Extra data track length {0}", entry.toc[entry.toc.TrackCount].LengthMSF) :
                         !entry.toc[1].IsAudio && this.toc[1].IsAudio ?
                         string.Format("Playstation type data track length {0}", entry.toc[entry.toc.FirstAudio].StartMSF) :

Remark:
Before the following commit, the situation was similar:
6c2ce26#diff-e17ccef09f7012c6d07655342e0c48ebL482
Using just

string dataTrackInfo = !entry.toc[entry.toc.TrackCount].IsAudio

I will prepare a PR...

from cuetools.net.

c72578 avatar c72578 commented on July 24, 2024

Here is an alternative fix:

diff --git a/CUETools.CTDB/CUEToolsDB.cs b/CUETools.CTDB/CUEToolsDB.cs
index b74a8ca..c8b0dc3 100644
--- a/CUETools.CTDB/CUEToolsDB.cs
+++ b/CUETools.CTDB/CUEToolsDB.cs
@@ -603,7 +603,7 @@ namespace CUETools.CTDB
                     string confFormat = (this.Total < 10) ? "{0:0}/{1:0}" :
                         (this.Total < 100) ? "{0:00}/{1:00}" : "{0:000}/{1:000}";
                     string conf = string.Format(confFormat, entry.conf, this.Total);
-                    string dataTrackInfo = !entry.toc[entry.toc.TrackCount].IsAudio && this.toc[this.toc.TrackCount].IsAudio ?
+                    string dataTrackInfo = !entry.toc[entry.toc.TrackCount].IsAudio && this.toc[1].IsAudio ?
                         string.Format("CD-Extra data track length {0}", entry.toc[entry.toc.TrackCount].LengthMSF) :
                         !entry.toc[1].IsAudio && this.toc[1].IsAudio ?
                         string.Format("Playstation type data track length {0}", entry.toc[entry.toc.FirstAudio].StartMSF) :

This checks, if the last track in the database entry is a data track and also, if the first track of the currently ripped CD is an audio track. The code is then similar to the "PlayStation" case below, but the other way round.

from cuetools.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.