summaryrefslogtreecommitdiffstats
path: root/lib/class
diff options
context:
space:
mode:
Diffstat (limited to 'lib/class')
-rw-r--r--lib/class/catalog.class.php8
-rw-r--r--lib/class/song.class.php10
2 files changed, 10 insertions, 8 deletions
diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php
index 0a7df3eb..02ff5280 100644
--- a/lib/class/catalog.class.php
+++ b/lib/class/catalog.class.php
@@ -908,7 +908,13 @@ class Catalog {
$songs = $album->get_songs(1);
$song = new Song($songs[0]);
$dir = dirname($song->file);
- $extension = substr($image['0']['mime'],strlen($image['0']['mime'])-3,3);
+
+ if ($image['0']['mime'] == 'image/jpeg') {
+ $extension = 'jpg';
+ }
+ else {
+ $extension = substr($image['0']['mime'],strlen($image['0']['mime'])-3,3);
+ }
// Try the preferred filename, if that fails use folder.???
$preferred_filename = Config::get('album_art_preferred_filename');
diff --git a/lib/class/song.class.php b/lib/class/song.class.php
index e9e92de6..b4541cf5 100644
--- a/lib/class/song.class.php
+++ b/lib/class/song.class.php
@@ -828,14 +828,10 @@ class Song extends database_object {
$web_path = Config::get('web_path');
+
if (Config::get('force_http_play') OR !empty($force_http)) {
- $port = Config::get('http_port');
- if (preg_match("/:\d+/",$web_path)) {
- $web_path = str_replace("https://", "http://",$web_path);
- }
- else {
- $web_path = str_replace("https://", "http://",$web_path);
- }
+ $port = Config::get('http_port') ? ':' . Config::get('http_port') : '';
+ $web_path = str_replace("https://" . $_SERVER['HTTP_HOST'], "http://" . $_SERVER['SERVER_NAME'] . $port,$web_path);
}
$url = $web_path . "/play/index.php?song=$song_id&uid=$user_id$session_string$ds_string&name=/$song_name";