Skip to content

Commit

Permalink
Adds MP3 endpoint for MessianicChords.com
Browse files Browse the repository at this point in the history
  • Loading branch information
JudahGabriel committed Apr 5, 2024
1 parent 62c7c9f commit 2771a56
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
7 changes: 6 additions & 1 deletion Chavah.NetCore/Controllers/AlbumsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,13 @@ public async Task<PagedList<Album>> GetAll(int skip, int take, string search)
}

[HttpGet]
public async Task<RedirectResult> GetAlbumArtBySongId(string songId)
public async Task<IActionResult> GetAlbumArtBySongId(string songId)
{
if (string.IsNullOrWhiteSpace(songId))
{
return BadRequest("songId must not be null or empty");
}

var song = await DbSession.LoadRequiredAsync<Song>(songId);
return Redirect(song.AlbumArtUri.ToString());
}
Expand Down
12 changes: 12 additions & 0 deletions Chavah.NetCore/Controllers/SongsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,18 @@ public async Task<List<Song>> ChooseSongBatch()
return songDto;
}

[HttpGet]
public async Task<IActionResult> GetMp3ById(string songId)
{
var song = await GetById(songId);
if (song == null)
{
return NotFound();
}

return Ok(song.Uri);
}

[HttpPost]
public async Task SongCompleted(string songId)
{
Expand Down
10 changes: 5 additions & 5 deletions Chavah.NetCore/wwwroot/css/app/footer.less
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
@thumb-border-width: 1px;
@thumb-border-color: white;

@track-width: 100%;
@track-width: 15px;
@track-height: 10px;
@track-shadow-size: 2px;
@track-shadow-blur: 2px;
Expand Down Expand Up @@ -136,9 +136,9 @@

input[type=range] {
position: absolute;
top: -75px;
right: -35px;
transform: rotateZ(-90deg);
top: -135px;
right: 21px;
writing-mode: vertical-lr;
-webkit-appearance: none; // override the default appearance
margin: @thumb-height/2 0;
width: @track-width;
Expand Down Expand Up @@ -188,7 +188,7 @@
background-color: @brand-background;
border-radius: 50px;
box-shadow: 0 0 5px 1px gray;
transition: all ease-in-out .5s;
transition: transform ease-in-out .5s;
opacity: 0.5;

img {
Expand Down
2 changes: 1 addition & 1 deletion Chavah.NetCore/wwwroot/views/partials/Footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

</div>

<a class="discord-chat" href="https://discord.gg/gKrqH4MApy" target="_blank" uib-tooltip="Chat with other Chavah listeners" tooltip-placement="left">
<a class="discord-chat" href="https://discord.gg/gKrqH4MApy" target="_blank" uib-tooltip="Chat with other Chavah listeners" tooltip-placement="left" ng-style="{ opacity: vm.volumeShown ? 0 : 1 }">
<img src="/images/discord.svg" width="35" height="35" loading="lazy" />
</a>
</section>
Expand Down

0 comments on commit 2771a56

Please sign in to comment.