var localPath = function() {
  // borrowed from PAMM-Atom
  if(process.platform === 'win32') {
    return process.env.LOCALAPPDATA.replace(/\\/g,"/");
  }
  else if(process.platform === 'linux') {
    return process.env.HOME + "/.local"
  }
  else if(process.platform === 'darwin') {
    return process.env.HOME + "/Library/Application Support"
  }
  else {
    // the user can change it anyway
    return process.env.HOME + "/.local"
  }
}

var paPath = function() {
  return localPath() + '/Uber Entertainment/Planetary Annihilation'
}

var mediaPath = function(stream) {
  if(process.platform === 'win32') {
    return paPath() + '/data/streams/' + stream + '/media/' // ????
  }
  else if(process.platform === 'linux') {
    return paPath() + '/' + stream + '/media/' // ????
  }
  else if(process.platform === 'darwin') {
    return paPath() + '/data/streams/' + stream +'/PA.app/Contents/Resources/media/'
  }
  else {
    // the user can change it anyway
    return paPath() + '/data/streams/' + stream + '/media/'
  }
}

module.exports = {
  local: localPath,
  pa: paPath,
  media: mediaPath,
}

@@ -1,12 +1,55 @@
+var existsSync = require('fs').existsSync%0A%0A
 var localPat
@@ -506,22 +506,27 @@
 n() %7B%0A  
-return
+var local =
  localPa
@@ -525,24 +525,55 @@
  localPath()
+%0A  var candidates = %5B%0A    local
  + '/Uber En
@@ -610,203 +610,555 @@
 tion
-'%0A%7D%0A%0Avar mediaPath = function(stream) %7B%0A  if(process.platform === 'win32') %7B%0A    return paPath() + '/data
+/data/streams',%0A    'C:/Games/Uber Entertainment/Planetary Annihilation Launcher/Planetary Annihilation',%0A    'D:/Games/Uber Entertainment/Planetary Annihilation Launcher/Planetary Annihilation',%0A    local + '/Steam/SteamApps/common/Planetary Annihilation',%0A    'C:/Program Files (x86)/Steam/SteamApps/common/Planetary Annihilation',%0A    'C:/Games/SteamLibrary
 /st
-r
 eam
-s/' + stream + '/media/' // ????%0A  %7D%0A  else if(process.platform === 'linux'
+apps/common/Planetary Annihilation',%0A    'D:/Games/SteamLibrary/steamapps/common/Planetary Annihilation',%0A  %5D%0A  for (var i in candidates) %7B%0A    if (existsSync(candidates%5Bi%5D)
 ) %7B%0A    
 retu
@@ -1157,50 +1157,179 @@
     
+  
 return 
-paPath() + '/' + stream + '
+candidates%5Bi%5D%0A    %7D%0A  %7D%0A%7D%0A%0Avar mediaPath = function(stream) %7B%0A  var pa = paPath()%0A  var candidates = %5B%0A    pa + '/' + stream + '/PA.app/Contents/Resources
 /media/'
  // 
@@ -1328,113 +1328,109 @@
 ia/'
+,
  // 
-????%0A  %7D%0A  else if(process.platform === 'darwin') %7B%0A    return paPath() + '/data/
+OS X%0A    pa + '/' + stream + '/media/', // windows, linux?%0A    pa + '/media', // 
 st
-r
 eam
-s/' + stream
+%0A    pa
  +
+ 
 '/PA
@@ -1462,120 +1462,128 @@
 edia
-/
 '
+, // steam OS X
 %0A  
-%7D%0A  else %7B%0A    // the user can change it anyway%0A    return paPath() + '/data/streams/' + stream + '/media/'
+%5D%0A  for (var i in candidates) %7B%0A    if (existsSync(candidates%5Bi%5D)) %7B%0A      return candidates%5Bi%5D%0A    %7D
 %0A  %7D

update paths module