diff Libs/LibSharedMedia-3.0/LibSharedMedia-3.0.lua @ 11:371e14cd2feb

- major fixes with icons not showing correctly.
author Tercio
date Thu, 08 Dec 2016 13:01:40 -0200
parents c31ee4251181
children 3596dadf9a90
line wrap: on
line diff
--- a/Libs/LibSharedMedia-3.0/LibSharedMedia-3.0.lua	Tue Oct 25 15:59:51 2016 -0200
+++ b/Libs/LibSharedMedia-3.0/LibSharedMedia-3.0.lua	Thu Dec 08 13:01:40 2016 -0200
@@ -1,6 +1,6 @@
 --[[
 Name: LibSharedMedia-3.0
-Revision: $Revision: 89 $
+Revision: $Revision: 91 $
 Author: Elkano (elkano@gmx.de)
 Inspired By: SurfaceLib by Haste/Otravi (troeks@gmail.com)
 Website: http://www.wowace.com/projects/libsharedmedia-3-0/
@@ -9,7 +9,7 @@
 License: LGPL v2.1
 ]]
 
-local MAJOR, MINOR = "LibSharedMedia-3.0", 6000201 -- 6.0.2 v1 / increase manually on changes
+local MAJOR, MINOR = "LibSharedMedia-3.0", 6010002 -- 6.1.0 v2 / increase manually on changes
 local lib = LibStub:NewLibrary(MAJOR, MINOR)
 
 if not lib then return end
@@ -223,6 +223,13 @@
 	end
 	mediatype = mediatype:lower()
 	if mediatype == lib.MediaType.FONT and ((langmask and band(langmask, LOCALE_MASK) == 0) or not (langmask or locale_is_western)) then return false end
+	if mediatype == lib.MediaType.SOUND and type(data) == "string" then
+		local path = data:lower()
+		-- Only ogg and mp3 are valid sounds.
+		if not path:find(".ogg", nil, true) and not path:find(".mp3", nil, true) then
+			return false
+		end
+	end
 	if not mediaTable[mediatype] then mediaTable[mediatype] = {} end
 	local mtable = mediaTable[mediatype]
 	if mtable[key] then return false end