Skip to content

Commit

Permalink
Remove Windows Home Server support
Browse files Browse the repository at this point in the history
  • Loading branch information
mherger committed Apr 1, 2024
1 parent 2790850 commit 58f1f66
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 88 deletions.
2 changes: 1 addition & 1 deletion Slim/Plugin/OnlineLibrary/Plugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ sub postinitPlugin {

Slim::Utils::Timers::setTimer(undef, time() + DELAY_FIRST_POLL, \&_pollOnlineLibraries);

main::INFOLOG && $log->is_info && $log->info("Online Music Library Integration initialized: " . join(', ', keys %onlineLibraryProviders) . DELAY_FIRST_POLL);
main::INFOLOG && $log->is_info && $log->info("Online Music Library Integration initialized: " . join(', ', keys %onlineLibraryProviders) . ' - ' . DELAY_FIRST_POLL);
}
}

Expand Down
5 changes: 2 additions & 3 deletions Slim/Plugin/iTunes/Common.pm
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,8 @@ sub checkDefaults {
# disable iTunes unless
# - an iTunes XML file is found
# - or we're on a Mac
# - or we're running Windows (but not Windows Home Server)
if (defined $class->findMusicLibraryFile() || main::ISMAC
|| (main::ISWINDOWS && !Slim::Utils::OSDetect->getOS()->get('isWHS'))) {
# - or we're running Windows
if (defined $class->findMusicLibraryFile() || main::ISMAC || main::ISWINDOWS) {
$prefs->set('itunes', 1);
}
else {
Expand Down
86 changes: 2 additions & 84 deletions Slim/Utils/OS/Win32.pm
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,6 @@ sub initPrefs {

sub canDBHighMem { 1 }

sub postInitPrefs {
my ($class, $prefs) = @_;

return if !$class->{osDetails}->{isWHS};

# bug 15818: on WHS we don't want iTunes to be started by default (Support request)
require Slim::Utils::Prefs;
my $pluginState = Slim::Utils::Prefs::preferences('plugin.state');
if (!defined $pluginState->get('iTunes')) {
$pluginState->set('iTunes', 'disabled');
}
}

sub dirsFor {
my ($class, $dir) = @_;

Expand Down Expand Up @@ -209,43 +196,6 @@ sub dirsFor {
} elsif ($dir =~ /^(?:music|playlists)$/) {

my $path;

# Windows Home Server offers a Music share which is more likely to be used
# than the administrator's My Music folder
# XXX - should we continue to support WHS?
if ($class->{osDetails}->{isWHS} && $dir =~ /^(?:music|playlists)$/) {
my $objWMI = Win32::OLE->GetObject('winmgmts://./root/cimv2');

if ( $objWMI && (my $shares = $objWMI->InstancesOf('Win32_Share')) ) {

my $path2;
foreach my $objShare (in $shares) {

# let's be a bit more open for localized versions: musica, Musik, musique...
if ($objShare->Name =~ /^musi(?:c|k|que|ca)$/i) {
$path = '\\\\' . hostname() . '\\' . $objShare->Name;
last;
}
elsif ($objShare->Path =~ /shares.*?musi[ckq]/i) {
$path = $objShare->Path;
last;
}
elsif ($objShare->path =~ /musi[ckq]/i) {
$path2 = $objShare->Path;
}
}

undef $shares;

# we didn't find x:\shares\music, but some other share with music in the path
if ($path2 && !$path) {
$path = $path2;
}
}

undef $objWMI;
}

my $fallback;

if ($dir =~ /^(?:music|playlists)$/) {
Expand Down Expand Up @@ -757,37 +707,8 @@ sub cleanupTempDirs {
sub getUpdateParams {
my ($class, $url) = @_;

return if main::SCANNER;

if (main::ISACTIVEPERL && !$PerlSvc::VERSION) {
Slim::Utils::Log::logger('server.update')->info("Running Lyrion Music Server from the source - don't download the update.");
return;
}

my $downloaddir;

if ($class->{osDetails}->{isWHS}) {
require Win32::NetResource;

my $share;
Win32::NetResource::NetShareGetInfo('software', $share);

# this is ugly... FR uses a localized share name
if (!$share || !$share->{path}) {
Win32::NetResource::NetShareGetInfo('logiciel', $share);
}

if ($share && $share->{path}) {
$downloaddir = $share->{path};

if (-e catdir($downloaddir, "Add-Ins")) {
$downloaddir = catdir($downloaddir, "Add-Ins");
}
}
}

return {
path => $downloaddir,
path => $class->dirsFor('updates'),
};
}

Expand All @@ -796,10 +717,7 @@ sub canAutoUpdate { 1 }
# return file extension filter for installer
sub installerExtension { '(?:exe|msi)' }

sub installerOS {
my $class = shift;
return $class->{osDetails}->{isWHS} ? 'whs' : 'win';
}
sub installerOS { 'win' }

sub restartServer {
my $class = shift;
Expand Down

0 comments on commit 58f1f66

Please sign in to comment.