Skip to content

Commit

Permalink
Merge pull request #14 from reubot/fix#9
Browse files Browse the repository at this point in the history
ability to add edit-notes
  • Loading branch information
kepstin authored Sep 22, 2024
2 parents c7113a5 + edbd134 commit 2599b10
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 17 deletions.
41 changes: 25 additions & 16 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
// Object, with properties:
// (same as in `isrcs`)
var pregapISRCs = null;
// Edit note to include with ISRC submission edit
var editNote = "";
// True if any ISRCs are valid, and the edit preview should be shown
var anyISRCsValid = false;
// State from the most recently popped history
Expand Down Expand Up @@ -493,8 +495,13 @@
});
}

function checkEditNote(params) {
editNote = params.get("edit-note") || "";
}

function handleRelease(params) {
renderReleaseProgress();
checkEditNote(params);
fetchRelease(mbid)
.then(release => {
checkISRCs(release, params);
Expand Down Expand Up @@ -687,6 +694,12 @@
}
}

if (editNote) {
const editNoteEl = doc.createElementNS(xmlns, "edit-note");
editNoteEl.textContent = editNote;
metadata.appendChild(editNoteEl);
}

return doc;
}

Expand Down Expand Up @@ -952,16 +965,12 @@ <h2 class="h4">
<p class="text-secondary">(no tracks)</p>
<% } %>
<% } %>
<div class="row">
<div class="col-11 col-sm-5 col-md-4 col-lg-3 offset-sm-1">
<button id="check-isrcs-submit" type="submit" class="btn btn-primary">Check ISRCs &amp; update edit preview</button>
</div>
</div>
<button id="check-isrcs-submit" type="submit" class="btn btn-primary">Check ISRCs &amp; update edit preview</button>
<% if (anyISRCsValid) { %>
<h1 class="mt-3 h3">Edit Preview</h1>
<div class="row">
<div class="col-12 col-sm-2 offset-lg-1">
<strong>Additions:</strong>
<div class="col-12 col-sm-2 offset-lg-1 form-label fw-bold">
Additions
</div>
<div class="col-12 col-sm-10 col-lg-9">
<ul class="list-unstyled">
Expand All @@ -976,15 +985,15 @@ <h1 class="mt-3 h3">Edit Preview</h1>
</ul>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-10 col-lg-9 offset-sm-2 offset-lg-3">
<% if (login.userInfo) { %>
<button id="edit-submit" class="btn btn-primary" type="button" onclick="doSubmitISRCs(); return false;">Enter edit</button>
<% } else { %>
<button class="btn btn-primary" type="button" onclick="doLogin(); return false;">Login to MusicBrainz</button>
<% } %>
</div>
</div>
<% } %>
<h2 class="h4 mt-3"><label for="edit-note">Edit note</label></h2>
<p>Entering an <a href="https://musicbrainz.org/doc/Edit_Note">edit note</a> that describes where you got your information is highly recommended. Not only does it make your sources clear (both now and to users who see the edit years later), but it can also encourage other users to vote on the edit — thus making it get applied faster.</p>
<p>Even just providing a URL or two is helpful! For more suggestions, see <a href="https://musicbrainz.org/doc/How_to_Write_Edit_Notes">the MusicBrainz guide for writing good edit notes</a>.</p>
<textarea class="form-control mb-3" rows="5" name="edit-note"><%= escapeHtml(editNote) %></textarea>
<% if (!login.userInfo) { %>
<button class="btn btn-primary" type="button" onclick="doLogin(); return false;">Login to MusicBrainz</button>
<% } else if (anyISRCsValid) { %>
<button id="edit-submit" class="btn btn-primary" type="button" onclick="doSubmitISRCs(); return false;">Enter edit</button>
<% } %>
</form>
</script>
Expand Down
2 changes: 1 addition & 1 deletion privacy.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h2>Data sent to MusicBrainz</h2>
<li><b>MusicBrainz access token.</b> (when submitting ISRCs)</li>
<li><b>Code verifier.</b> (when logging in)</li>
<li><b>Release MBID.</b> (when loading a release)</li>
<li><b>Recording MBIDs and ISRCs.</b> (when submitting ISRCs)</li>
<li><b>Recording MBIDs, ISRCs, and Edit Note.</b> (when submitting ISRCs)</li>
</ul>
<h2>Web access logs</h2>
<p>Like many other web services, I keep logs of all web requests made to this service. These logs are used for diagnostic and traffic management purposes, and no information from them is sent to any third party or made available publicly. The logs are deleted after 14 days, although anonymized aggregate traffic data may be preserved indefinitely. The following personal data is logged:</p>
Expand Down
5 changes: 5 additions & 0 deletions seeding.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ <h2 id="documentation">Documentation</h2>
<p>An ISRC, specified by sequential position.</p>
<p>If you just have a list of ISRCs but you do not know how they are split between media, use this format. This parameter format is primarily supported for backwards compatibility with older ISRC submission tools – please use the Medium &amp; Track format instead if possible. Within the name of the parameter, <code><u>N</u></code> is replaced with the position (counting from 1). CD pregap tracks are not supported; they will be skipped in the numbering sequence.</p>
</dd>
<dt class="col-12"><code>edit-note</code></dt>
<dd class="col offset-1">
<p>An edit note to include with the ISRC addition edit.</p>
<p>See the <a href="https://musicbrainz.org/doc/Edit_Note">MusicBrainz Edit Note documentation</a> for detail on the use and formatting of an edit note, and <a href="https://musicbrainz.org/doc/How_to_Write_Edit_Notes">How to Write Edit Notes</a> for more information on what a good edit note should include.</p>
</dd>
</dl>
</div>
<footer class="text-muted my-3">
Expand Down

0 comments on commit 2599b10

Please sign in to comment.