-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathspotyxbmc.diff
514 lines (482 loc) · 18.2 KB
/
spotyxbmc.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
Index: xbmc/XBApplicationEx.cpp
===================================================================
--- xbmc/XBApplicationEx.cpp (revision 35256)
+++ xbmc/XBApplicationEx.cpp (arbetskopia)
@@ -21,6 +21,11 @@
#include "system.h"
#include "XBApplicationEx.h"
#include "utils/log.h"
+
+//spotify
+#include "spotinterface.h"
+#include "AdvancedSettings.h"
+
#ifdef HAS_PERFORMANCE_SAMPLE
#include "utils/PerformanceSample.h"
#else
@@ -86,6 +91,13 @@
try
{
#endif
+
+ //spotify, advance the spotifyAPI
+ if (g_advancedSettings.m_spotifyEnable)
+ {
+ g_spotifyInterface->processEvents();
+ }
+
Process();
//reset exception count
processExceptionCount = 0;
Index: xbmc/cores/paplayer/Makefile.in
===================================================================
--- xbmc/cores/paplayer/Makefile.in (revision 35256)
+++ xbmc/cores/paplayer/Makefile.in (arbetskopia)
@@ -9,7 +9,7 @@
CFLAGS+=-DHAS_ALSA
-SRCS=AC3CDDACodec.cpp AC3Codec.cpp ADPCMCodec.cpp AIFFcodec.cpp AudioDecoder.cpp CDDAcodec.cpp CodecFactory.cpp VGMCodec.cpp FLACcodec.cpp MP3codec.cpp NSFCodec.cpp OGGcodec.cpp ReplayGain.cpp SIDCodec.cpp TimidityCodec.cpp WAVcodec.cpp WAVPackcodec.cpp YMCodec.cpp DVDPlayerCodec.cpp DTSCodec.cpp DTSCDDACodec.cpp PAPlayer.cpp OggCallback.cpp ModplugCodec.cpp
+SRCS=spotifyCodec.cpp AC3CDDACodec.cpp AC3Codec.cpp ADPCMCodec.cpp AIFFcodec.cpp AudioDecoder.cpp CDDAcodec.cpp CodecFactory.cpp VGMCodec.cpp FLACcodec.cpp MP3codec.cpp NSFCodec.cpp OGGcodec.cpp ReplayGain.cpp SIDCodec.cpp TimidityCodec.cpp WAVcodec.cpp WAVPackcodec.cpp YMCodec.cpp DVDPlayerCodec.cpp DTSCodec.cpp DTSCDDACodec.cpp PAPlayer.cpp OggCallback.cpp ModplugCodec.cpp
ifeq (@USE_ASAP_CODEC@,1)
SRCS+=ASAPCodec.cpp
Index: xbmc/cores/paplayer/CodecFactory.cpp
===================================================================
--- xbmc/cores/paplayer/CodecFactory.cpp (revision 35256)
+++ xbmc/cores/paplayer/CodecFactory.cpp (arbetskopia)
@@ -19,6 +19,10 @@
*
*/
+//spotify
+#include "spotifyCodec.h"
+#include "../utils/log.h"
+
#include "system.h"
#include "CodecFactory.h"
#include "MP3codec.h"
@@ -52,7 +56,12 @@
ICodec* CodecFactory::CreateCodec(const CStdString& strFileType)
{
- if (strFileType.Equals("mp3") || strFileType.Equals("mp2"))
+ CLog::Log(LOGERROR, "Spotifylog: createcodec: %s", strFileType.c_str());
+ //spotify
+ if (strFileType.Equals("spotify"))
+ return new SpotifyCodec();
+
+ else if (strFileType.Equals("mp3") || strFileType.Equals("mp2"))
return new MP3Codec();
else if (strFileType.Equals("ape") || strFileType.Equals("mac"))
return new DVDPlayerCodec();
@@ -131,7 +140,11 @@
ICodec* CodecFactory::CreateCodecDemux(const CStdString& strFile, const CStdString& strContent, unsigned int filecache)
{
CURL urlFile(strFile);
- if( strContent.Equals("audio/mpeg")
+
+ //spotify
+ if ( strFile.Right(7).Equals("spotify") )
+ return new SpotifyCodec();
+ else if( strContent.Equals("audio/mpeg")
|| strContent.Equals("audio/mp3") )
return new MP3Codec();
else if( strContent.Equals("audio/aac")
Index: xbmc/cores/paplayer/PAPlayer.cpp
===================================================================
--- xbmc/cores/paplayer/PAPlayer.cpp (revision 35256)
+++ xbmc/cores/paplayer/PAPlayer.cpp (arbetskopia)
@@ -33,6 +33,8 @@
#include "../AudioRenderers/AudioRendererFactory.h"
#include "../../utils/TimeUtils.h"
#include "utils/log.h"
+//spotify
+#include "spotifyCodec.h"
#ifdef _LINUX
#define XBMC_SAMPLE_RATE 44100
@@ -544,9 +546,15 @@
return false;
UpdateCacheLevel();
-
+
// check whether we should queue the next file up
- if ((GetTotalTime64() > 0) && GetTotalTime64() - GetTime() < TIME_TO_CACHE_NEXT_FILE + m_crossFading * 1000L && !m_cachingNextFile)
+ //spotify, we can only get the new file if the old one is done reading
+ bool isSpotifyFree = true;
+ if (m_decoder[m_currentDecoder].GetCodec()->m_CodecName == "spotify")
+ {
+ isSpotifyFree = SpotifyCodec::spotifyPlayerIsFree();
+ }
+ if (isSpotifyFree && (GetTotalTime64() > 0) && GetTotalTime64() - GetTime() < TIME_TO_CACHE_NEXT_FILE + m_crossFading * 1000L && !m_cachingNextFile)
{ // request the next file from our application
m_callback.OnQueueNextItem();
m_cachingNextFile = true;
Index: xbmc/Application.cpp
===================================================================
--- xbmc/Application.cpp (revision 35256)
+++ xbmc/Application.cpp (arbetskopia)
@@ -22,6 +22,9 @@
#if (defined HAVE_CONFIG_H) && (!defined WIN32)
#include "config.h"
#endif
+//spotify
+#include "spotinterface.h"
+
#include "Application.h"
#include "utils/Builtins.h"
#include "utils/Variant.h"
@@ -1119,6 +1122,14 @@
else
g_windowManager.ActivateWindow(g_SkinInfo->GetFirstWindow());
+ //spotify
+ if (g_advancedSettings.m_spotifyEnable)
+ {
+ g_spotifyInterface = new SpotifyInterface;
+ g_spotifyInterface->connect(false);
+ }
+
+
g_sysinfo.Refresh();
CLog::Log(LOGINFO, "removing tempfiles");
@@ -3327,6 +3338,12 @@
g_lcd=NULL;
}
#endif
+ //spotify
+ if (g_advancedSettings.m_spotifyEnable)
+ {
+ delete g_spotifyInterface;
+ }
+ g_spotifyInterface = 0;
g_Windowing.DestroyRenderSystem();
g_Windowing.DestroyWindowSystem();
Index: xbmc/AdvancedSettings.cpp
===================================================================
--- xbmc/AdvancedSettings.cpp (revision 35256)
+++ xbmc/AdvancedSettings.cpp (arbetskopia)
@@ -59,6 +59,16 @@
m_karaokeAlwaysEmptyOnCdgs = 1;
m_karaokeUseSongSpecificBackground = 0;
+ //spotify
+ m_spotifyEnable = true;
+ m_spotifyUseHighBitrate = true;
+ m_spotifyUsername = "";
+ m_spotifyPassword = "";
+ m_spotifyCacheFolder = "/tmp/spotify/";
+ m_spotifyMaxSearchArtists = 50;
+ m_spotifyMaxSearchAlbums = 50;
+ m_spotifyMaxSearchTracks = 100;
+
m_audioDefaultPlayer = "paplayer";
m_audioPlayCountMinimumPercent = 90.0f;
m_audioHost = "default";
@@ -661,6 +671,20 @@
XMLUtils::GetInt(pElement, "movielength", m_iMythMovieLength);
}
+ //spotify
+ pElement = pRootElement->FirstChildElement("spotify");
+ if (pElement)
+ {
+ XMLUtils::GetBoolean(pElement, "enable", m_spotifyEnable);
+ XMLUtils::GetBoolean(pElement, "highbitrate", m_spotifyUseHighBitrate);
+ XMLUtils::GetString(pElement, "username", m_spotifyUsername);
+ XMLUtils::GetString(pElement, "password", m_spotifyPassword);
+ XMLUtils::GetString(pElement, "cachefolder", m_spotifyCacheFolder);
+ XMLUtils::GetInt(pElement, "maxsearchartists", m_spotifyMaxSearchArtists, 0, 500);
+ XMLUtils::GetInt(pElement, "maxsearchalbums", m_spotifyMaxSearchAlbums,0,500);
+ XMLUtils::GetInt(pElement, "maxsearchtracks", m_spotifyMaxSearchTracks,0,1000);
+ }
+
// EDL commercial break handling
pElement = pRootElement->FirstChildElement("edl");
if (pElement)
Index: xbmc/MusicDatabase.h
===================================================================
--- xbmc/MusicDatabase.h (revision 35256)
+++ xbmc/MusicDatabase.h (arbetskopia)
@@ -116,6 +116,10 @@
void EmptyCache();
void Clean();
int Cleanup(CGUIDialogProgress *pDlgProgress);
+
+ //spotify, we need a new function to remove albums from the database
+ bool RemoveAlbum(CStdString albumPath);
+
void DeleteAlbumInfo();
bool LookupCDDBInfo(bool bRequery=false);
void DeleteCDDBInfo();
Index: xbmc/FileSystem/Directory.cpp
===================================================================
--- xbmc/FileSystem/Directory.cpp (revision 35256)
+++ xbmc/FileSystem/Directory.cpp (arbetskopia)
@@ -144,9 +144,9 @@
pDirectory->SetExtFileInfo(extFileInfo);
bool result = false;
- while (!result)
- {
- if (g_application.IsCurrentThread() && allowThreads && !CUtil::IsSpecial(strPath))
+ while (!result)
+ {
+if (g_application.IsCurrentThread() && allowThreads && !CUtil::IsSpecial(strPath) && strPath.Left(18) != "musicdb://spotify/")
{
CSingleExit ex(g_graphicsContext);
Index: xbmc/FileSystem/MusicDatabaseDirectory.cpp
===================================================================
--- xbmc/FileSystem/MusicDatabaseDirectory.cpp (revision 35256)
+++ xbmc/FileSystem/MusicDatabaseDirectory.cpp (arbetskopia)
@@ -29,6 +29,8 @@
#include "TextureManager.h"
#include "LocalizeStrings.h"
#include "utils/log.h"
+//spotify
+#include "spotinterface.h"
using namespace std;
using namespace XFILE;
@@ -44,6 +46,12 @@
bool CMusicDatabaseDirectory::GetDirectory(const CStdString& strPath, CFileItemList &items)
{
+ //spotify
+ if (strPath.Left(18) == "musicdb://spotify/")
+ {
+ return g_spotifyInterface->getDirectory(strPath, items);
+ }
+
auto_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(strPath));
if (!pNode.get())
@@ -66,6 +74,11 @@
NODE_TYPE CMusicDatabaseDirectory::GetDirectoryChildType(const CStdString& strPath)
{
+ //spotify
+ if (strPath.Left(18) == "musicdb://spotify/")
+ {
+ return g_spotifyInterface->getChildType(strPath);
+ }
auto_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(strPath));
if (!pNode.get())
Index: xbmc/MusicDatabase.cpp
===================================================================
--- xbmc/MusicDatabase.cpp (revision 35256)
+++ xbmc/MusicDatabase.cpp (arbetskopia)
@@ -1588,6 +1588,33 @@
m_thumbCache.erase(m_thumbCache.begin(), m_thumbCache.end());
}
+//spotify
+bool CMusicDatabase::RemoveAlbum(CStdString albumPath)
+{
+ albumPath.Delete(0,12);
+ CUtil::RemoveSlashAtEnd(albumPath);
+ try
+ {
+ if (NULL == m_pDB.get()) return false;
+ if (NULL == m_pDS.get()) return false;
+
+ CStdString strSQL;
+ strSQL=FormatSQL("delete from song where idAlbum=%s", albumPath.c_str());
+ m_pDS->exec(strSQL.c_str());
+ strSQL=FormatSQL("delete from album where idAlbum=%s", albumPath.c_str());
+ m_pDS->exec(strSQL.c_str());
+ this->CleanupSongs();
+ this->CleanupAlbums();
+ return true;
+ }
+ catch (...)
+ {
+ CLog::Log(LOGERROR, "%s failed", __FUNCTION__);
+ }
+
+ return false;
+}
+
bool CMusicDatabase::Search(const CStdString& search, CFileItemList &items)
{
unsigned int time = CTimeUtils::GetTimeMS();
@@ -1855,7 +1882,8 @@
CUtil::RemoveSlashAtEnd(strFileName);
}
- if (!CFile::Exists(strFileName))
+ //spotify, dont delete it if its a spotify song
+ if (CUtil::GetExtension(strFileName) !=".spotify" && !CFile::Exists(strFileName))
{ // file no longer exists, so add to deletion list
strSongsToDelete += m_pDS->fv("song.idSong").get_asString() + ",";
}
Index: xbmc/Makefile.in
===================================================================
--- xbmc/Makefile.in (revision 35256)
+++ xbmc/Makefile.in (arbetskopia)
@@ -17,8 +17,8 @@
INCLUDES+=-I../lib/jsoncpp/jsoncpp/include
INCLUDES+=-Ilib/cpluff/libcpluff
-
-SRCS=Application.cpp \
+SRCS=spotinterface.cpp \
+ Application.cpp \
CueDocument.cpp \
GUISettings.cpp \
GUIWindowAddonBrowser.cpp \
Index: xbmc/GUIViewStateMusic.cpp
===================================================================
--- xbmc/GUIViewStateMusic.cpp (revision 35256)
+++ xbmc/GUIViewStateMusic.cpp (arbetskopia)
@@ -23,6 +23,8 @@
#include "PlayListPlayer.h"
#include "GUIBaseContainer.h" // for VIEW_TYPE_*
#include "VideoDatabase.h"
+//spotify
+#include "MusicDatabase.h"
#include "GUISettings.h"
#include "AdvancedSettings.h"
#include "Settings.h"
@@ -514,6 +516,18 @@
void CGUIViewStateWindowMusicNav::AddOnlineShares()
{
+ //spotify, only if we do use spotify
+ CLog::Log(LOGDEBUG,"Adding spotify share");
+ if (g_advancedSettings.m_spotifyEnable)
+ {
+ CMediaSource share;
+ share.strName="Spotify"; // main menu
+ share.strPath = "musicdb://spotify/menu/main/";
+ //share.m_strThumbnailImage = CUtil::GetDefaultFolderThumb("special://xbmc/media/spotify_core_logo.png");
+ share.m_iDriveType = CMediaSource::SOURCE_TYPE_LOCAL;
+ m_sources.push_back(share);
+ }
+
if (!g_advancedSettings.m_bVirtualShares) return;
for (int i = 0; i < (int)g_settings.m_musicSources.size(); ++i)
{
Index: xbmc/GUIDialogContextMenu.h
===================================================================
--- xbmc/GUIDialogContextMenu.h (revision 35256)
+++ xbmc/GUIDialogContextMenu.h (arbetskopia)
@@ -110,7 +110,9 @@
CONTEXT_BUTTON_USER7,
CONTEXT_BUTTON_USER8,
CONTEXT_BUTTON_USER9,
- CONTEXT_BUTTON_USER10
+ CONTEXT_BUTTON_USER10,
+ //spotify add a button for removing albums from lib
+ CONTEXT_BUTTON_SPOTIFY_REMOVE_ALBUM
};
class CContextButtons : public std::vector< std::pair<unsigned int, CStdString> >
Index: xbmc/GUIWindowMusicNav.cpp
===================================================================
--- xbmc/GUIWindowMusicNav.cpp (revision 35256)
+++ xbmc/GUIWindowMusicNav.cpp (arbetskopia)
@@ -108,6 +108,10 @@
if (!CGUIWindowMusicBase::OnMessage(message))
return false;
+ //spotify we still want a library view if we have spotify enabled
+ if (g_advancedSettings.m_spotifyEnable)
+ return true;
+
// base class has opened the database, do our check
DisplayEmptyDatabaseMessage(m_musicdatabase.GetSongsCount() <= 0);
@@ -482,6 +486,10 @@
if (strcmp(g_settings.m_defaultMusicLibSource, ""))
buttons.Add(CONTEXT_BUTTON_CLEAR_DEFAULT, 13403); // clear default
}
+
+ //spotify add the remove album button
+ buttons.Add(CONTEXT_BUTTON_SPOTIFY_REMOVE_ALBUM,"Remove album");
+
NODE_TYPE childtype = dir.GetDirectoryChildType(item->m_strPath);
if (childtype == NODE_TYPE_ALBUM ||
childtype == NODE_TYPE_ARTIST ||
@@ -548,8 +556,22 @@
if (itemNumber >= 0 && itemNumber < m_vecItems->Size())
item = m_vecItems->Get(itemNumber);
+ //spotify
+ CSongMap songMap;
+ CMusicDatabase db;
+
switch (button)
{
+ //spotify remove the album
+ case CONTEXT_BUTTON_SPOTIFY_REMOVE_ALBUM:
+ db.Open();
+ db.BeginTransaction();
+ db.RemoveAlbum(item->m_strPath);
+ db.CommitTransaction();
+ db.Close();
+ Update(m_history.GetParentPath());
+ return true;
+
case CONTEXT_BUTTON_INFO:
{
if (!item->IsVideoDb())
Index: xbmc/AdvancedSettings.h
===================================================================
--- xbmc/AdvancedSettings.h (revision 35256)
+++ xbmc/AdvancedSettings.h (arbetskopia)
@@ -83,6 +83,16 @@
float m_audioPlayCountMinimumPercent;
bool m_dvdplayerIgnoreDTSinWAV;
+ //Spotify
+ bool m_spotifyEnable;
+ bool m_spotifyUseHighBitrate;
+ CStdString m_spotifyUsername;
+ CStdString m_spotifyPassword;
+ CStdString m_spotifyCacheFolder;
+ int m_spotifyMaxSearchArtists;
+ int m_spotifyMaxSearchAlbums;
+ int m_spotifyMaxSearchTracks;
+
float m_videoSubsDelayRange;
float m_videoAudioDelayRange;
int m_videoSmallStepBackSeconds;
Index: xbmc/Settings.cpp
===================================================================
--- xbmc/Settings.cpp (revision 35256)
+++ xbmc/Settings.cpp (arbetskopia)
@@ -106,7 +106,7 @@
m_bNonLinStretch = false;
m_pictureExtensions = ".png|.jpg|.jpeg|.bmp|.gif|.ico|.tif|.tiff|.tga|.pcx|.cbz|.zip|.cbr|.rar|.m3u|.dng|.nef|.cr2|.crw|.orf|.arw|.erf|.3fr|.dcr|.x3f|.mef|.raf|.mrw|.pef|.sr2|.rss";
- m_musicExtensions = ".nsv|.m4a|.flac|.aac|.strm|.pls|.rm|.rma|.mpa|.wav|.wma|.ogg|.mp3|.mp2|.m3u|.mod|.amf|.669|.dmf|.dsm|.far|.gdm|.imf|.it|.m15|.med|.okt|.s3m|.stm|.sfx|.ult|.uni|.xm|.sid|.ac3|.dts|.cue|.aif|.aiff|.wpl|.ape|.mac|.mpc|.mp+|.mpp|.shn|.zip|.rar|.wv|.nsf|.spc|.gym|.adx|.dsp|.adp|.ymf|.ast|.afc|.hps|.xsp|.xwav|.waa|.wvs|.wam|.gcm|.idsp|.mpdsp|.mss|.spt|.rsd|.mid|.kar|.sap|.cmc|.cmr|.dmc|.mpt|.mpd|.rmt|.tmc|.tm8|.tm2|.oga|.url|.pxml|.tta|.rss|.cm3|.cms|.dlt|.brstm";
+ m_musicExtensions = ".nsv|.m4a|.flac|.aac|.strm|.pls|.rm|.rma|.mpa|.wav|.wma|.ogg|.mp3|.mp2|.m3u|.mod|.amf|.669|.dmf|.dsm|.far|.gdm|.imf|.it|.m15|.med|.okt|.s3m|.stm|.sfx|.ult|.uni|.xm|.sid|.ac3|.dts|.cue|.aif|.aiff|.wpl|.ape|.mac|.mpc|.mp+|.mpp|.shn|.zip|.rar|.wv|.nsf|.spc|.gym|.adx|.dsp|.adp|.ymf|.ast|.afc|.hps|.xsp|.xwav|.waa|.wvs|.wam|.gcm|.idsp|.mpdsp|.mss|.spt|.rsd|.mid|.kar|.sap|.cmc|.cmr|.dmc|.mpt|.mpd|.rmt|.tmc|.tm8|.tm2|.oga|.url|.pxml|.tta|.rss|.cm3|.cms|.dlt|.brstm|.spotify";
m_videoExtensions = ".m4v|.3g2|.3gp|.nsv|.tp|.ts|.ty|.strm|.pls|.rm|.rmvb|.m3u|.ifo|.mov|.qt|.divx|.xvid|.bivx|.vob|.nrg|.img|.iso|.pva|.wmv|.asf|.asx|.ogm|.m2v|.avi|.bin|.dat|.mpg|.mpeg|.mp4|.mkv|.avc|.vp3|.svq3|.nuv|.viv|.dv|.fli|.flv|.rar|.001|.wpl|.zip|.vdr|.dvr-ms|.xsp|.mts|.m2t|.m2ts|.evo|.ogv|.sdp|.avs|.rec|.url|.pxml|.vc1|.h264|.rcv|.rss|.mpls|.webm|.bdmv";
// internal music extensions
m_musicExtensions += "|.sidstream|.oggstream|.nsfstream|.asapstream|.cdda";
Index: xbmc/GUIMediaWindow.cpp
===================================================================
--- xbmc/GUIMediaWindow.cpp (revision 35256)
+++ xbmc/GUIMediaWindow.cpp (arbetskopia)
@@ -61,6 +61,9 @@
#endif
#include "utils/Builtins.h"
+//spotify
+#include "spotinterface.h"
+
#define CONTROL_BTNVIEWASICONS 2
#define CONTROL_BTNSORTBY 3
#define CONTROL_BTNSORTASC 4
@@ -909,8 +912,9 @@
if (!items.AlwaysCache())
items.RemoveDiscCache(GetID());
+ //spotify, why? well not a very good way but it works, now we can perform operations without changing directory
CFileItem directory(*pItem);
- if (!Update(directory.m_strPath))
+ if (!Update(directory.m_strPath) && directory.m_strPath.Left(26) !="musicdb://spotify/command/")
ShowShareErrorMessage(&directory);
return true;
Index: xbmc/utils/GUIInfoManager.cpp
===================================================================
--- xbmc/utils/GUIInfoManager.cpp (revision 35256)
+++ xbmc/utils/GUIInfoManager.cpp (arbetskopia)
@@ -33,6 +33,8 @@
#include "addons/Visualisation.h"
#include "ButtonTranslator.h"
#include "utils/AlarmClock.h"
+//spotify
+#include "AdvancedSettings.h"
#ifdef HAS_LCD
#include "utils/LCD.h"
#endif
@@ -4352,7 +4354,11 @@
CMusicDatabase db;
if (db.Open())
{
- m_libraryHasMusic = (db.GetSongsCount() > 0) ? 1 : 0;
+ //spotify
+ if (g_advancedSettings.m_spotifyEnable)
+ m_libraryHasMusic = 1;
+ else
+ m_libraryHasMusic = (db.GetSongsCount() > 0) ? 1 : 0;
db.Close();
}
}