summaryrefslogtreecommitdiffstats
path: root/lib/private/Repair
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-11-09 09:41:01 +0100
committerGitHub <noreply@github.com>2017-11-09 09:41:01 +0100
commiteab2b3b7aee7734c5c1253a1be3896e0ecf7947c (patch)
tree5747db94c7628b9cf7d8fc92ce7221e8be9a5a55 /lib/private/Repair
parent6b3975c23aa3a2579107f1ecba5355c10f736c2b (diff)
parentba6e5bcc051e825c9048a5bd1f2680d1c04661de (diff)
downloadnextcloud-server-eab2b3b7aee7734c5c1253a1be3896e0ecf7947c.tar.gz
nextcloud-server-eab2b3b7aee7734c5c1253a1be3896e0ecf7947c.zip
Merge pull request #7027 from nextcloud/Rello-patch-1
Rello patch 1
Diffstat (limited to 'lib/private/Repair')
-rw-r--r--lib/private/Repair/RepairMimeTypes.php27
1 files changed, 22 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');
+ }
}
}