diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-11-09 09:41:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-09 09:41:01 +0100 |
commit | eab2b3b7aee7734c5c1253a1be3896e0ecf7947c (patch) | |
tree | 5747db94c7628b9cf7d8fc92ce7221e8be9a5a55 | |
parent | 6b3975c23aa3a2579107f1ecba5355c10f736c2b (diff) | |
parent | ba6e5bcc051e825c9048a5bd1f2680d1c04661de (diff) | |
download | nextcloud-server-eab2b3b7aee7734c5c1253a1be3896e0ecf7947c.tar.gz nextcloud-server-eab2b3b7aee7734c5c1253a1be3896e0ecf7947c.zip |
Merge pull request #7027 from nextcloud/Rello-patch-1
Rello patch 1
-rw-r--r-- | lib/private/Repair/RepairMimeTypes.php | 27 | ||||
-rw-r--r-- | resources/config/mimetypemapping.dist.json | 3 |
2 files changed, 25 insertions, 5 deletions
diff --git a/lib/private/Repair/RepairMimeTypes.php b/lib/private/Repair/RepairMimeTypes.php index e98a7f52366..2b259175623 100644 --- a/lib/private/Repair/RepairMimeTypes.php +++ b/lib/private/Repair/RepairMimeTypes.php @@ -92,6 +92,7 @@ class RepairMimeTypes implements IRepairStep { $this->folderMimeTypeId = (int)$result->fetchOne(); } + $count = 0; foreach ($updatedMimetypes as $extension => $mimetype) { $result = \OC_DB::executeAudited(self::existsStmt(), array($mimetype)); $exists = $result->fetchOne(); @@ -106,8 +107,10 @@ class RepairMimeTypes implements IRepairStep { $mimetypeId = $result->fetchOne(); // change mimetype for files with x extension - \OC_DB::executeAudited(self::updateByNameStmt(), array($mimetypeId, $this->folderMimeTypeId, $mimetypeId, '%.' . $extension)); + $count += \OC_DB::executeAudited(self::updateByNameStmt(), array($mimetypeId, $this->folderMimeTypeId, $mimetypeId, '%.' . $extension)); } + + return $count; } private function introduceImageTypes() { @@ -116,7 +119,7 @@ class RepairMimeTypes implements IRepairStep { 'webp' => 'image/webp', ); - $this->updateMimetypes($updatedMimetypes); + return $this->updateMimetypes($updatedMimetypes); } private function introduceWindowsProgramTypes() { @@ -126,7 +129,7 @@ class RepairMimeTypes implements IRepairStep { 'cmd' => 'application/cmd', ); - $this->updateMimetypes($updatedMimetypes); + return $this->updateMimetypes($updatedMimetypes); } private function introduceLocationTypes() { @@ -137,7 +140,7 @@ class RepairMimeTypes implements IRepairStep { 'tcx' => 'application/vnd.garmin.tcx+xml', ]; - $this->updateMimetypes($updatedMimetypes); + return $this->updateMimetypes($updatedMimetypes); } private function introduceInternetShortcutTypes() { @@ -146,7 +149,17 @@ class RepairMimeTypes implements IRepairStep { 'webloc' => 'application/internet-shortcut' ]; - $this->updateMimetypes($updatedMimetypes); + return $this->updateMimetypes($updatedMimetypes); + } + + private function introduceStreamingTypes() { + $updatedMimetypes = [ + 'm3u' => 'audio/mpegurl', + 'm3u8' => 'audio/mpegurl', + 'pls' => 'audio/x-scpls' + ]; + + return $this->updateMimetypes($updatedMimetypes); } /** @@ -174,5 +187,9 @@ class RepairMimeTypes implements IRepairStep { if (version_compare($ocVersionFromBeforeUpdate, '13.0.0.3', '<') && $this->introduceInternetShortcutTypes()) { $out->info('Fixed internet-shortcut mime types'); } + + if (version_compare($ocVersionFromBeforeUpdate, '13.0.0.6', '<') && $this->introduceStreamingTypes()) { + $out->info('Fixed streaming mime types'); + } } } diff --git a/resources/config/mimetypemapping.dist.json b/resources/config/mimetypemapping.dist.json index 06e4d30b9e5..ef3de4d75dc 100644 --- a/resources/config/mimetypemapping.dist.json +++ b/resources/config/mimetypemapping.dist.json @@ -88,6 +88,8 @@ "ldif": ["text/x-ldif"], "lwp": ["application/vnd.lotus-wordpro"], "m2t": ["video/mp2t"], + "m3u": ["audio/mpegurl"], + "m3u8": ["audio/mpegurl"], "m4a": ["audio/mp4"], "m4b": ["audio/m4b"], "m4v": ["video/mp4"], @@ -129,6 +131,7 @@ "pef": ["image/x-dcraw"], "php": ["application/x-php"], "pl": ["application/x-perl"], + "pls": ["audio/x-scpls"], "png": ["image/png"], "pot": ["application/vnd.ms-powerpoint"], "potm": ["application/vnd.ms-powerpoint.template.macroEnabled.12"], |