Skip to content

Commit

Permalink
Status update as of September 2023
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaDoes committed May 12, 2024
1 parent d1953e1 commit 075cd4b
Show file tree
Hide file tree
Showing 13 changed files with 168 additions and 93 deletions.
Empty file removed css/audioplayer.css
Empty file.
2 changes: 1 addition & 1 deletion css/libremedia.css
Original file line number Diff line number Diff line change
Expand Up @@ -310,4 +310,4 @@ button {

button:focus {
outline: none;
}
}
7 changes: 7 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,24 @@ require (
)

require (
github.com/CAFxX/httpcompression v0.0.8 // indirect
github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/PuerkitoBio/goquery v1.8.1 // indirect
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/andybalholm/cascadia v1.3.2 // indirect
github.com/badfortrains/mdns v0.0.0-20160325001438-447166384f51 // indirect
github.com/brynbellomy/klog v0.0.0-20200414031930-87fbf2e555ae // indirect
github.com/dsoprea/go-logging v0.0.0-20200710184922-b02d349568dd // indirect
github.com/eolso/threadsafe v0.0.0-20230304165831-d28da4e4d0d3 // indirect
github.com/go-errors/errors v1.4.2 // indirect
github.com/go-http-utils/etag v0.0.0-20161124023236-513ea8f21eb1 // indirect
github.com/go-http-utils/fresh v0.0.0-20161124030543-7231e26a4b27 // indirect
github.com/go-http-utils/headers v0.0.0-20181008091004-fed159eddc2a // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/gosimple/slug v1.13.1 // indirect
github.com/gosimple/unidecode v1.0.1 // indirect
github.com/jfbus/httprs v1.0.1 // indirect
github.com/klauspost/compress v1.14.1 // indirect
github.com/miekg/dns v1.1.55 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
Expand Down
18 changes: 18 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
github.com/CAFxX/httpcompression v0.0.8 h1:UBWojERnpCS6X7whJkGGZeCC3ruZBRwkwkcnfGfb0ko=
github.com/CAFxX/httpcompression v0.0.8/go.mod h1:bVd1taHK1vYb5SWe9lwNDCqrfj2ka+C1Zx7JHzxuHnU=
github.com/JoshuaDoes/json v0.0.0-20200726213358-ec3860544ac0 h1:315Zb0n+8KwZyUiIKbDGvfrQ003c0XfHYNy0M4vv5cA=
github.com/JoshuaDoes/json v0.0.0-20200726213358-ec3860544ac0/go.mod h1:vsCdx75bni6k6GIQPPima8KiM7ZjNHeBJ8keBaJOADA=
github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=
github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c=
github.com/PuerkitoBio/goquery v1.4.1 h1:smcIRGdYm/w7JSbcdeLHEMzxmsBQvl8lhf0dSw2nzMI=
github.com/PuerkitoBio/goquery v1.4.1/go.mod h1:T9ezsOHcCrDCgA8aF1Cqr3sSYbO/xgdy8/R/XiIMAhA=
github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM=
github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ=
github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY=
github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/andybalholm/cascadia v1.0.0 h1:hOCXnnZ5A+3eVDX8pvgl4kofXv2ELss0bKcqRySc45o=
github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
Expand Down Expand Up @@ -37,12 +43,19 @@ github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm
github.com/go-errors/errors v1.0.2/go.mod h1:psDX2osz5VnTOnFWbDeWwS7yejl+uV3FEWEp4lssFEs=
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
github.com/go-http-utils/etag v0.0.0-20161124023236-513ea8f21eb1 h1:zga7zaRE8HCbWjcXMDlfvmQtH0/kMVLo7cQ48dy6kWg=
github.com/go-http-utils/etag v0.0.0-20161124023236-513ea8f21eb1/go.mod h1:PumS+5d59wmAGsZo6IfRpVNaJUq+6xjC4Utt/k8GO6Q=
github.com/go-http-utils/fresh v0.0.0-20161124030543-7231e26a4b27 h1:O6yi4xa9b2DMosGsXzlMe2E9qXgXCVkRLCoRX+5amxI=
github.com/go-http-utils/fresh v0.0.0-20161124030543-7231e26a4b27/go.mod h1:AYvN8omj7nKLmbcXS2dyABYU6JB1Lz1bHmkkq1kf4I4=
github.com/go-http-utils/headers v0.0.0-20181008091004-fed159eddc2a h1:v6zMvHuY9yue4+QkG/HQ/W67wvtQmWJ4SDo9aK/GIno=
github.com/go-http-utils/headers v0.0.0-20181008091004-fed159eddc2a/go.mod h1:I79BieaU4fxrw4LMXby6q5OS9XnoR9UIKLOzDFjUmuw=
github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI=
github.com/golang/geo v0.0.0-20200319012246-673a6f80352d/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/brotli/go/cbrotli v0.0.0-20210623081221-ce222e317e36/go.mod h1:nOPhAkwVliJdNTkj3gXpljmWhjc4wCaVqbMJcPKWP4s=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
Expand All @@ -56,6 +69,9 @@ github.com/jfbus/httprs v1.0.1 h1:kIf3dk5QlEiBDPnY88BRHI6iQ1HepvYD8Fb8zVmiNDU=
github.com/jfbus/httprs v1.0.1/go.mod h1:M9fpbEbf1Ns5RSaTkvnykqBCdJkwNtYAoAC73Ie9bEs=
github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/klauspost/compress v1.14.1 h1:hLQYb23E8/fO+1u53d02A97a8UnsddcvYzq4ERRU4ds=
github.com/klauspost/compress v1.14.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
github.com/librespot-org/librespot-golang v0.0.0-20220325184705-31669e5a889f h1:tTMPsyVClxxV+CnlLqzgxTTTFM6J7i//rSejN1Md0b0=
github.com/librespot-org/librespot-golang v0.0.0-20220325184705-31669e5a889f/go.mod h1:LeHPXRci2Bg6RBmw8BDEFH5nfb8oGU6mll+qTH8UIzw=
github.com/miekg/dns v1.1.8/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
Expand All @@ -67,6 +83,7 @@ github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa1
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/pierrec/lz4/v4 v4.1.12/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand All @@ -85,6 +102,7 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
github.com/valyala/gozstd v1.11.0/go.mod h1:y5Ew47GLlP37EkTB+B4s7r6A5rdaeB7ftbl9zoYiIPQ=
github.com/xlab/portaudio-go v0.0.0-20170905165025-132d041879db h1:sSIQlvfIWUHLDhEWUL2K2CeYv9CDksC00VxuxPUe4lw=
github.com/xlab/portaudio-go v0.0.0-20170905165025-132d041879db/go.mod h1:r57mRacDQMS6Fz8ubv1nE8zZ0DbQ/sY0NkCmdxeUXmY=
github.com/xlab/vorbis-go v0.0.0-20190125051917-087364aef51d/go.mod h1:AMqfx3jFwPqem3u8mF2lsRodZs30jG/Mag5HZ3mB3sA=
Expand Down
17 changes: 9 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
<!DOCTYPE html>
<html lang="en-US" encoding="utf8">
<head>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1" />
<title>libremedia</title>

<!-- Third-party libraries -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="//unpkg.com/navigo" type="text/javascript"></script>
<script src="/js/jszip.min.js" type="text/javascript"></script>
<script src="/js/navigo-8.11.1.min.js" type="text/javascript"></script>
<!--<script src="/js/jszip.min.js" type="text/javascript"></script>
<script src="/js/jszip-utils.min.js" type="text/javascript"></script>
<script src="/js/FileSaver.min.js" type="text/javascript"></script>
<script src="/js/FileSaver.min.js" type="text/javascript"></script>-->

<!-- libremedia -->
<link rel="stylesheet" type="text/css" href="/css/libremedia.css">
<link rel="stylesheet" type="text/css" href="/css/audioplayer.css">
<!-- Audio player -->
<script src="/js/libremedia/audioplayer.js" type="text/javascript"></script>

<!-- libremedia JavaScript client -->
<link rel="stylesheet" type="text/css" href="/css/libremedia.css">
<script src="/js/libremedia/libremedia-api.js" type="text/javascript"></script>
<script src="/js/libremedia/libremedia-artwork.js" type="text/javascript"></script>
<script src="/js/libremedia/libremedia-downloader.js" type="text/javascript"></script>
Expand All @@ -28,7 +30,6 @@
<script src="/js/libremedia/libremedia.js" type="text/javascript"></script>

<!-- Third-party style sheets -->
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
</head>
<body>
Expand All @@ -38,7 +39,7 @@
<div id="notification"></div>
<div id="nav"></div>
<div id="infobar">
<audio preload="metdata" id="audioPlayer" src="" hidden></audio>
<audio preload="none" id="audioPlayer" src="" hidden></audio>
<div id="audioInfo"></div>
<div id="audioControls"></div>
<div id="audioTimer"></div>
Expand Down
8 changes: 3 additions & 5 deletions js/libremedia/libremedia-artwork.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ function setBgImg(url) {
newbg = "";
}

if (document.body.style.backgroundImage !== newbg) {
//console.log("Setting background " + url + " using " + newbg + " to replace " + document.body.style.backgroundImage);
document.body.style.backgroundImage = newbg;
bgImg = url;
}
//console.log("Setting background " + url + " using " + newbg + " to replace " + document.body.style.backgroundImage);
document.body.style.backgroundImage = newbg;
bgImg = url;
}

function setBgStream(stream) {
Expand Down
20 changes: 15 additions & 5 deletions js/libremedia/libremedia-downloader.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
function downloadStream(match) {
async function downloadStream(match) {
if (match.params == null) {
pagePotato(match);
return;
}
var uri = match.params.uri;

var stream = (await v1GetObject(uri)).object;
if (stream == null) {
displayNotification("Download not ready!", 3000);
return;
}

var hostname = window.location.hostname;
var urlpath = "https://" + hostname + "/v1/download/" + uri;
var port = window.location.port;
if (port != "")
port = ":" + port;
var protocol = location.protocol;
var urlpath = protocol + "//" + hostname + port + "/v1/download/" + uri;
window.open(urlpath, "_blank");
pagePotato(match);

var stream = v1GetObject(uri).object;
const creator = '<div id="creator"><a href="/creator?uri=' + stream.creators[0].object.uri + '" data-navigo>' + stream.creators[0].object.name + '</a></div>';
const albumObj = v1GetObject(stream.album.object.uri).object;
const albumObj = (await v1GetObject(stream.album.object.uri)).object;
const album = '<div id="album"><a href="/album?uri=' + stream.album.object.uri + '" data-navigo>' + albumObj.name + '</a>';
const name = '<div id="stream"><a href="/stream?uri=' + uri + '" data-navigo>' + stream.name + '</a></div>';

Expand All @@ -29,4 +39,4 @@ function downloadAlbum(albumURI) {

function downloadDiscography(creatorURI) {
//console.log("Not implemented yet! TODO: Download " + creatorURI + " as ZIP");
}
}
1 change: 1 addition & 0 deletions js/libremedia/libremedia-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ function navigoResolve() {
.on((match) => {
//console.log("Nothing to do!");
render(match, "");
setBgImg("https://files.joshuadoes.com/randombackground_redirect.php");
})
.resolve();
}
Expand Down
Loading

0 comments on commit 075cd4b

Please sign in to comment.