Work in Progress - Developer Area

  Thread Rating:
  • 3 Votes - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
m.savazzi Offline
Moderator
Posts: 908
Joined: Mar 2008
Reputation: 28
Post: #31
(2013-05-26 09:27)Cocotus Wrote:  
(2013-05-25 00:32)m.savazzi Wrote:  
(2013-05-24 21:17)Cocotus Wrote:  I read this thread an didn't found any sketch/scheme besides Dans picture (nice work!) to display the new scheme. Is there a place where I can take a look at the structure? (like example MediaDatabaseSQL_v1.txt, demo.emm database which can be watched with SQLITEBrowser?) If this hasn't be done maybe we should pick the current MediaDatabaseSQL_v1.txt which displays all the Ember tables and just post here and mark/edit the changes based on our discussion?

sent link via PM
thanks for sending! ok I looked into that and looks fine to me - the tag/keyword table we talked about is missing I think, but it's just 1:1 copy of genre-table just (different name) so thats no problem at all.
Thats for the tables/relations in database - I noticed there aren't any columns/field names mentioned yet but I think we can use the current fields of ember tables and dropping the "HAS..." fields which we can obtain with SQL query..

Removing other tables, adding new Keywords table

Cocotus I've not understood what you mean here:
(2013-05-26 09:27)Cocotus Wrote:  I noticed there aren't any columns/field names mentioned yet but I think we can use the current fields of ember tables and dropping the "HAS..." fields which we can obtain with SQL query..
What are you talking?

If you think I'm useful please use the +/- button to raise my reputation
find quote
m.savazzi Offline
Moderator
Posts: 908
Joined: Mar 2008
Reputation: 28
Post: #32
Cocotus, DanCooper,
I was working on the DB and found an issue, the Primary key of episodes must be
Series / Season / Episode

cannot be only Series / Episode Smile

Fixing it

If you think I'm useful please use the +/- button to raise my reputation
find quote
m.savazzi Offline
Moderator
Posts: 908
Joined: Mar 2008
Reputation: 28
Post: #33
Another major chabge in the DB is to remove the autonumber ID for tables that does not need it.

For example Genre does not need an autonumber as the strGenre must be unique.
So the PK is the strGenre not an autonumber.

Now some tables are quite fun as Keywords just have the PK. I've left them in any case so that the insert and management procedure is identical than all the others tables AND to be future proof (let's say we want to add an image for keywords, or anything else)


also I've made the IMDB and the TVDB ids mandatory. Do you agree? We need some unique identifies to link with online

M

Note the TV shows are stored in:
TVShow
Season
Episode

the relationship is:
Season -(idTVShow)-> TVShow
Episode -(idTVShow, idSeason)-> Season
Episode -(idTVShow)-> TvShow

If a field (i.e. actor) apply to:
- TVShow it does need only: idTVShow
- Season: idTVShow, idSeason
- Episode: idTVShow, idSeason, idEpisode

So the link tables need a triplette (show, season, episode) to identify the target episode.


Updated db structure is in the file online Smile (I deleted all non useful tables). Please recheck it as there could be errors!

If you think is ok we can lock the structure and create the views (the ones with the Booleans Smile)

Here is the structure:
[Image: db1z.png]

If you think I'm useful please use the +/- button to raise my reputation
(This post was last modified: 2013-05-26 15:54 by m.savazzi.)
find quote
Cocotus Offline
Moderator
Posts: 328
Joined: Mar 2011
Reputation: 7
Post: #34
Quote:
(2013-05-26 09:27)Cocotus Wrote:  I noticed there aren't any columns/field names mentioned yet but I think we can use the current fields of ember tables and dropping the "HAS..." fields which we can obtain with SQL query..
What are you talking?

Hi, dropping the HASColumns I related to this answer from you where I agree:
Quote:
(2013-05-17 14:58)DanCooper Wrote:  [*]Why do you have removed all "Has*****" column? Do you want check every time "If NotNullOrEmpty -> PosterPath" while the movie is loading?
All main lists use this entries for the green tick mark.
[/list]

I do not want to do that, but they are useless as fields as they have to be put in the View on the table, in other words those fields are
select count(file)>0 from files where type = 1 {fanart} and files.movieid = movieid
or even select count(file) from files where type = 1 {fanart} and files.movieid = movieid

in this way we avoid multiple updates, add file, update flag etc... is just a source of errors Smile

BTW, thanks for doing all the databasse work/setup - I'm prette dumb at this area, so I just say it looks good and looks fine imo Smile
(This post was last modified: 2013-05-27 08:58 by Cocotus.)
find quote
DanCooper Offline
Moderator
Posts: 1,527
Joined: Apr 2012
Reputation: 73
Location: Switzerland
Post: #35
Sorry guys, I had no time in the last days for Ember. This week I'll do the things promised.

Latest Ember-MM version - [Release] Ember Media Manager 1.3.x
German XBMCNerds
find quote
m.savazzi Offline
Moderator
Posts: 908
Joined: Mar 2008
Reputation: 28
Post: #36
Welcome back Smile

If you think I'm useful please use the +/- button to raise my reputation
find quote
bodrick Offline
Moderator
Posts: 133
Joined: Aug 2009
Reputation: 18
Post: #37
Oh and just to throw this in the ring, in regards to DB design and implementation, thats actually what I do professionally so I have a good idea and handle on the best way to organize the data, that always bugged me about the version of Ember I ended up working with and wanted to completely redesign the thing lol.

Have you guys considered using the EntityFramework for DB access? I started working on moving to it with my 2.0 branch and it appeared to work well with SQLite. The added bonus that you can visualize the layout of the DB within Visual Studio rather than relying on having to generate diagrams. The other big benefit is the ability to associate items and query them using Linq rather than having to write SQL queries.

We do all this for the fun of it, we don't care about the rewards or the riches, we do it because its who we are.

Visit my project page for Ember at http://ember.purplepig.net
(This post was last modified: 2013-05-29 21:33 by bodrick.)
find quote
m.savazzi Offline
Moderator
Posts: 908
Joined: Mar 2008
Reputation: 28
Post: #38
DanCooper,
have you added this?
[Image: errorchk.png]

LOL

you need to fix it Smile

(2013-05-29 21:32)bodrick Wrote:  Oh and just to throw this in the ring, in regards to DB design and implementation, thats actually what I do professionally so I have a good idea and handle on the best way to organize the data, that always bugged me about the version of Ember I ended up working with and wanted to completely redesign the thing lol.
Bodrick,
this is great, I've done db design some years ago but I'm quite rusty. I will send you the link to the DB via PM can you please look at it? Provide suggestions, fix it etc...

I've put in PK, FK and relationship, some indexes.
We need to create the appropriate views for queries Smile


(2013-05-29 21:32)bodrick Wrote:  Have you guys considered using the EntityFramework for DB access? I started working on moving to it with my 2.0 branch and it appeared to work well with SQLite. The added bonus that you can visualize the layout of the DB within Visual Studio rather than relying on having to generate diagrams. The other big benefit is the ability to associate items and query them using Linq rather than having to write SQL queries.

I've thought of it but is could lead to a mess as not a lot of people is very good in using Entity Framework and LINQ. I've seen what has happened through time on other areas of the code where people contributed (great and thank to all of them) but they were not comfortable with the technical choices that were done (i.e. the interface, module structure) se they added code where they were comfortable.
This lead to a patchwork kind of code with overlaid/repeated functionalities that was a mess to maintain and difficult to improve. (see for example the image handling I almost rewrote and the scraper modules and process I rewrote)

Here is the link to the info http://msdn.microsoft.com/en-us/data/aa937723.

I think a great step ahead is to have a real relational DB with the constraint in place and info organized.

The queries are very easy for (almost) everyone to understand and read Smile

I'm ok either to keep the queries or to go to EntityFramework, DanCooper, Cocotus what would you suggest?


M

If you think I'm useful please use the +/- button to raise my reputation
(This post was last modified: 2013-05-30 15:17 by m.savazzi.)
find quote
bodrick Offline
Moderator
Posts: 133
Joined: Aug 2009
Reputation: 18
Post: #39
(2013-05-30 15:08)m.savazzi Wrote:  DanCooper,
have you added this?
[Image: errorchk.png]

LOL

you need to fix it Smile

(2013-05-29 21:32)bodrick Wrote:  Oh and just to throw this in the ring, in regards to DB design and implementation, thats actually what I do professionally so I have a good idea and handle on the best way to organize the data, that always bugged me about the version of Ember I ended up working with and wanted to completely redesign the thing lol.
Bodrick,
this is great, I've done db design some years ago but I'm quite rusty. I will send you the link to the DB via PM can you please look at it? Provide suggestions, fix it etc...

I've put in PK, FK and relationship, some indexes.
We need to create the appropriate views for queries Smile


(2013-05-29 21:32)bodrick Wrote:  Have you guys considered using the EntityFramework for DB access? I started working on moving to it with my 2.0 branch and it appeared to work well with SQLite. The added bonus that you can visualize the layout of the DB within Visual Studio rather than relying on having to generate diagrams. The other big benefit is the ability to associate items and query them using Linq rather than having to write SQL queries.

I've thought of it but is could lead to a mess as not a lot of people is very good in using Entity Framework and LINQ. I've seen what has happened through time on other areas of the code where people contributed (great and thank to all of them) but they were not comfortable with the technical choices that were done (i.e. the interface, module structure) se they added code where they were comfortable.
This lead to a patchwork kind of code with overlaid/repeated functionalities that was a mess to maintain and difficult to improve. (see for example the image handling I almost rewrote and the scraper modules and process I rewrote)

Here is the link to the info http://msdn.microsoft.com/en-us/data/aa937723.

I think a great step ahead is to have a real relational DB with the constraint in place and info organized.

The queries are very easy for (almost) everyone to understand and read Smile

I'm ok either to keep the queries or to go to EntityFramework, DanCooper, Cocotus what would you suggest?


M

I totally agree with you on the source code, it is a bit of a mismatch hodpodge of code tacked on and bandaided. I actually spent a lot of time reworking some of it in my 2.0 branch that could be applied potentially to the 1.4 branch, some being the simplification of the settings etc. I also have potentially code that could eliminate our need to keep maintaining updated scrapers, and instead use the scrapers that come with XBMC, the functionality had been part of Ember a long time ago, but it was broken for the longest time, I updated it and worked with Olympia in testing and making sure it worked. That was for Eden, I'm not sure about Frodo but I suspect the changes won't be too bad to implement.

In regards to the EntityFramework, I've been developing with it now for a couple of years for my job and have to admit its been a good choice for my projects. You can really achieve some amazing stuff with it that would be very hard to comprehend in just straight SQL, and trust me I tried lol. So obviously its up to the rest of the team to offer their opinions etc.

Another thing that I was working on and I don't know if you would agree or disagree, but I believe the Module/Plugin framework is a waste of time, hard to maintain and overcomplicates everything. I understand the reasoning for doing it, but in the whole time I don't think anyone wrote a single module for Ember that wasn't part of the original team, with maybe minor exceptions for band aiding scraper functionality. The downside is the Module/Plugin framework is very tightly woven into Ember, I've spent a lot of time trying to purge it but haven't got there yet. I'm wondering if maybe there is a way to incorporate the work I've done with the work you guys have done. Something we should discuss going forward.

We do all this for the fun of it, we don't care about the rewards or the riches, we do it because its who we are.

Visit my project page for Ember at http://ember.purplepig.net
find quote
DanCooper Offline
Moderator
Posts: 1,527
Joined: Apr 2012
Reputation: 73
Location: Switzerland
Post: #40
(2013-05-30 15:08)m.savazzi Wrote:  DanCooper,
have you added this?
[Image: errorchk.png]

LOL

you need to fix it Smile

Yes that was me Cool I had not sorted clean since many changes are necessary (in the settings). I would like to reduce the setting where we have a check box for XBMC and one for YAMJ. In addition, a separate window with "expert" settings.

Latest Ember-MM version - [Release] Ember Media Manager 1.3.x
German XBMCNerds
find quote
Cocotus Offline
Moderator
Posts: 328
Joined: Mar 2011
Reputation: 7
Post: #41
First: Wooot bodrick, welcome!
Second: My knowledge of entity framework is.....NONE. but my knowledge of SQL isn't that great either, so IMO I can live with both solutions. I don't know whats better and worse. But I suspect the effort to switch from SQL in Ember to something new for database queries, is quite overwhelming so my vote goes to: SQL queries old style! BTW, I will start to work on the feature points as soon we have a 1.4 version set up with new database. Do we still need to port all the changes from latest 1.3 version to 1.4, or is that step already done by Dan?
(This post was last modified: 2013-05-31 19:48 by Cocotus.)
find quote
m.savazzi Offline
Moderator
Posts: 908
Joined: Mar 2008
Reputation: 28
Post: #42
(2013-05-30 18:32)bodrick Wrote:  I totally agree with you on the source code, it is a bit of a mismatch hodpodge of code tacked on and bandaided. I actually spent a lot of time reworking some of it in my 2.0 branch that could be applied potentially to the 1.4 branch, some being the simplification of the settings etc. I also have potentially code that could eliminate our need to keep maintaining updated scrapers, and instead use the scrapers that come with XBMC, the functionality had been part of Ember a long time ago, but it was broken for the longest time, I updated it and worked with Olympia in testing and making sure it worked. That was for Eden, I'm not sure about Frodo but I suspect the changes won't be too bad to implement.

That is the XML Scraper, if you are able to have it work great. But I would NOT replace the scrapers, will provide more info below.
For the code you have prepared for 2.0 let us know, happy to see it.

Please note that we have been working heavily on the internal structure of the picture management (now is all in memory, downloading only thumbs, optimizing network traffic, optimizing quality) and I've tried to make it easy to extend to other pictures (cd art, clear art, etc).

(2013-05-30 18:32)bodrick Wrote:  In regards to the EntityFramework, I've been developing with it now for a couple of years for my job and have to admit its been a good choice for my projects. You can really achieve some amazing stuff with it that would be very hard to comprehend in just straight SQL, and trust me I tried lol. So obviously its up to the rest of the team to offer their opinions etc.

Open to their opinions too

(2013-05-30 18:32)bodrick Wrote:  Another thing that I was working on and I don't know if you would agree or disagree, but I believe the Module/Plugin framework is a waste of time, hard to maintain and overcomplicates everything. I understand the reasoning for doing it, but in the whole time I don't think anyone wrote a single module for Ember that wasn't part of the original team, with maybe minor exceptions for band aiding scraper functionality. The downside is the Module/Plugin framework is very tightly woven into Ember, I've spent a lot of time trying to purge it but haven't got there yet. I'm wondering if maybe there is a way to incorporate the work I've done with the work you guys have done. Something we should discuss going forward.

bodrick, I do agree on some points but my approach (and the one in 1.4 we are following) is to split ALL the scrapers into independent modules.
the idea of external module is very good because gives a lot of flexibility and agility to add new metadata or picture sources.
Having a monolithic program is bad and will lead to an unmanageable codebase.

If you look at the new scrapers I've done they are all lightweight, very simple and very efficient; this is how they should have been since day 0.

the "macro scraper" IMDB and TV together was a mess.

Also I'm planning to SPLIT the multifunction modules into separate. EVERY function should be an independent module! with it's own project.
In this way the code will be clean, easy to maintain and bugs will not propagate widely.

I've started to clean up a lot of the code so I'd suggest you review the 1.4 codebase Smile

(2013-05-30 18:35)DanCooper Wrote:  
(2013-05-30 15:08)m.savazzi Wrote:  DanCooper,
have you added this?
[Image: errorchk.png]

LOL

you need to fix it Smile

Yes that was me Cool I had not sorted clean since many changes are necessary (in the settings). I would like to reduce the setting where we have a check box for XBMC and one for YAMJ. In addition, a separate window with "expert" settings.

Dan,
not clear what you want to do there Smile can you explain better?

The YAMJ module, if I remember correctly, is part of the mess module multi.somthing. I will chop them into all different modules as now they are a code mess Confused
Do you agree?

If you are able to simply the settings it's great but in the end works quite fine Smile (is bad to change but from a user perspective it works)

M

(2013-05-31 19:47)Cocotus Wrote:  First: Wooot bodrick, welcome!
Second: My knowledge of entity framework is.....NONE. but my knowledge of SQL isn't that great either, so IMO I can live with both solutions. I don't know whats better and worse. But I suspect the effort to switch from SQL in Ember to something new for database queries, is quite overwhelming so my vote goes to: SQL queries old style! BTW, I will start to work on the feature points as soon we have a 1.4 version set up with new database. Do we still need to port all the changes from latest 1.3 version to 1.4, or is that step already done by Dan?

I think Dan have to do some cleanup.

Cocotus I would suggest you start to create an independent scraper for Trak.tv Smile (it should be easy starting from the new Data scrapers)

Also you may check if there is any functionality is not mainly impacted from the DB changes.

Let's see what Dan prefers but maybe we can keep SQL in this phase and then, if we see too many limitations, swap to EF later...

The change of the DB structure will reflect on the internal data structure and thus I expect on a lot of the modules... (AND we have to make sure all DB access is done via the DB Class and not directly in other parts of the code)
... while once that the DB is in place swapping SQL to EF should be essentially limited to the DB class. Easier to manage Smile

Probably a two step (update DB and SQL and then swap to EF if better) is the safest approach...

M

If you think I'm useful please use the +/- button to raise my reputation
(This post was last modified: 2013-06-01 00:50 by m.savazzi.)
find quote
DanCooper Offline
Moderator
Posts: 1,527
Joined: Apr 2012
Reputation: 73
Location: Switzerland
Post: #43
The YAMJ module use different filenames and path to save the images. I think we can move this settings to the Ember standard settings page.
My idea was to create 2 tabs: predefined settings and expert settings.
predefined settings tab:
one checkbox for Eden
one checkbox for Frodo
one checkbox for YAMJ

These settings use only the XBMC and YAMJ standard (database export) filenames and paths.

expert settings:
all other options like "folder.jpg"...

Currently it is very difficult in the code. Everything must be checked several times to save all images properly.
For example:

Code:
If (Master.eSettings.VideoTSParent OrElse Master.eSettings.VideoTSParentXBMC) AndAlso FileUtils.Common.isVideoTS(mMovie.Filename) Then
                With Master.eSettings
                    If .MovieNameJPG Then
                        ...
                        End If
                    End If

                    If .MovieJPG Then
                        ...
                    End If

                    If .FolderJPG Then
                        ...
                    End If

                    If .PosterJPG Then
                        ...
                    End If

                    If .MovieNameJPG Then
                        ...
                    End If

                    If .MovieNameDashPosterJPG And Not Master.eSettings.VideoTSParentXBMC Then
                        ...
                    End If

                    If .MovieNameDashPosterJPG And Master.eSettings.VideoTSParentXBMC Then
                        ...
                    End If

                    If .MovieTBN Then
                        ...
                    End If

                    If .PosterTBN Then
                        ...
                    End If
                End With
            ElseIf (Master.eSettings.VideoTSParent OrElse Master.eSettings.VideoTSParentXBMC) AndAlso FileUtils.Common.isBDRip(mMovie.Filename) Then
                With Master.eSettings
                    If .MovieNameJPG Then
                       ...
                    End If

                    If .MovieJPG Then
                       ...
                    End If

                    If .FolderJPG Then
                       ...
                    End If

                    If .PosterJPG Then
                       ...
                    End If

                    If .MovieNameTBN Then
                       ...
                    End If

                    If .MovieNameDashPosterJPG And Not Master.eSettings.VideoTSParentXBMC Then
                        ...
                    End If

                    If .MovieNameDashPosterJPG And Master.eSettings.VideoTSParentXBMC Then
                       ...
                    End If

                    If .MovieTBN Then
                       ...
                    End If

                    If .PosterTBN Then
                       ...
                    End If
                End With
            Else

New we could make it clearer:

Code:
If FileUtils.Common.isVideoTS(mMovie.Filename) Then
                With Master.eSettings
                    If .Eden Then
                        ...
                    End If

                    If .Frodo Then
                        ...
                    End If

                    If .YAMJ Then
                       ...
                    End If
                    
                    If .expertSettings Then
                        ...
                    End If
                End With
ElseIf FileUtils.Common.isBDRip(mMovie.Filename) Then
                With Master.eSettings
                    If .Eden Then
                       ...
                    End If

                    If .Frodo Then
                        ...
                    End If

                    If .YAMJ Then
                        ...
                    End If
                    
                    If .expertSettings Then
                        ...
                    End If
                End With
Else
                With Master.eSettings
                    If .Eden Then
                       ...
                    End If

                    If .Frodo Then
                        ...
                    End If

                    If .YAMJ Then
                        ...
                    End If
                    
                    If .expertSettings Then
                        ...
                    End If
                End With
End If

Latest Ember-MM version - [Release] Ember Media Manager 1.3.x
German XBMCNerds
find quote
m.savazzi Offline
Moderator
Posts: 908
Joined: Mar 2008
Reputation: 28
Post: #44
(2013-06-02 17:17)DanCooper Wrote:  The YAMJ module use different filenames and path to save the images. I think we can move this settings to the Ember standard settings page.
My idea was to create 2 tabs: predefined settings and expert settings.
predefined settings tab:
one checkbox for Eden
one checkbox for Frodo
one checkbox for YAMJ

These settings use only the XBMC and YAMJ standard (database export) filenames and paths.

expert settings:
all other options like "folder.jpg"...

Currently it is very difficult in the code. Everything must be checked several times to save all images properly.
For example:

Code:
If (Master.eSettings.VideoTSParent OrElse Master.eSettings.VideoTSParentXBMC) AndAlso FileUtils.Common.isVideoTS(mMovie.Filename) Then
                With Master.eSettings
                    If .MovieNameJPG Then
                        ...
                        End If
                    End If

                    If .MovieJPG Then
                        ...
                    End If

                    If .FolderJPG Then
                        ...
                    End If

                    If .PosterJPG Then
                        ...
                    End If

                    If .MovieNameJPG Then
                        ...
                    End If

                    If .MovieNameDashPosterJPG And Not Master.eSettings.VideoTSParentXBMC Then
                        ...
                    End If

                    If .MovieNameDashPosterJPG And Master.eSettings.VideoTSParentXBMC Then
                        ...
                    End If

                    If .MovieTBN Then
                        ...
                    End If

                    If .PosterTBN Then
                        ...
                    End If
                End With
            ElseIf (Master.eSettings.VideoTSParent OrElse Master.eSettings.VideoTSParentXBMC) AndAlso FileUtils.Common.isBDRip(mMovie.Filename) Then
                With Master.eSettings
                    If .MovieNameJPG Then
                       ...
                    End If

                    If .MovieJPG Then
                       ...
                    End If

                    If .FolderJPG Then
                       ...
                    End If

                    If .PosterJPG Then
                       ...
                    End If

                    If .MovieNameTBN Then
                       ...
                    End If

                    If .MovieNameDashPosterJPG And Not Master.eSettings.VideoTSParentXBMC Then
                        ...
                    End If

                    If .MovieNameDashPosterJPG And Master.eSettings.VideoTSParentXBMC Then
                       ...
                    End If

                    If .MovieTBN Then
                       ...
                    End If

                    If .PosterTBN Then
                       ...
                    End If
                End With
            Else

New we could make it clearer:

Code:
If FileUtils.Common.isVideoTS(mMovie.Filename) Then
                With Master.eSettings
                    If .Eden Then
                        ...
                    End If

                    If .Frodo Then
                        ...
                    End If

                    If .YAMJ Then
                       ...
                    End If
                    
                    If .expertSettings Then
                        ...
                    End If
                End With
ElseIf FileUtils.Common.isBDRip(mMovie.Filename) Then
                With Master.eSettings
                    If .Eden Then
                       ...
                    End If

                    If .Frodo Then
                        ...
                    End If

                    If .YAMJ Then
                        ...
                    End If
                    
                    If .expertSettings Then
                        ...
                    End If
                End With
Else
                With Master.eSettings
                    If .Eden Then
                       ...
                    End If

                    If .Frodo Then
                        ...
                    End If

                    If .YAMJ Then
                        ...
                    End If
                    
                    If .expertSettings Then
                        ...
                    End If
                End With
End If

I like it!

BUT

if we leave the Expert settings you cannot get rid of the complex code! (because is needed for the expert) AND you must add all the others.

I'm wondering if the Expert settings is needed for someone or we can just go with the three options.

M

If you think I'm useful please use the +/- button to raise my reputation
find quote
rassilon22 Offline
Junior Member
Posts: 26
Joined: Aug 2010
Reputation: 0
Post: #45
Here's two code changes that helped me wrangle a TV Show directory hierarchy into shape for .NFO purposes for XBMC using Ember.

(This was from the 1.3.1.13 branch from Github.)

First: in SelectEpisodeRow() in frmMain fill in the episode information from the info that we do have
if calling LoadEpisodeInfo is inappropriate.

Second: In ScanTVSourceDir() search ALL subdirectories of the root of a TV show and not JUST the immediate sub-directories.

I'd imagine these ought to work against 1.4.x if they make sense.

Thoughts?
Bill

Code:
diff --git a/Ember Media Manager/frmMain.vb b/Ember Media Manager/frmMain.vb
index 116da63..c9df4da 100644
--- a/Ember Media Manager/frmMain.vb    
+++ b/Ember Media Manager/frmMain.vb    
@@ -7718,6 +7718,7 @@ doCancel:
                 Me.ShowNoInfo(True, 2)

                 Master.currShow = Master.DB.LoadTVEpFromDB(Convert.ToInt32(Me.dgvTVEpisodes.Item(0, iRow).Value), True)
+                Me.fillScreenInfoWithEpisode()

                 If Not Convert.ToBoolean(Me.dgvTVEpisodes.Item(22, iRow).Value) AndAlso Not Me.fScanner.IsBusy AndAlso Not Me.bwMediaInfo.IsBusy AndAlso Not Me.bwLoadInfo.IsBusy AndAlso Not Me.bwLoadShowInfo.IsBusy AndAlso Not Me.bwLoadSeasonInfo.IsBusy AndAlso Not Me.bwLoadEpInfo.IsBusy AndAlso Not Me.bwRefreshMovies.IsBusy AndAlso Not Me.bwCleanDB.IsBusy Then
                     Me.mnuEpisodes.Enabled = True
diff --git a/EmberAPI/clsAPIScanner.vb b/EmberAPI/clsAPIScanner.vb
index 46be93b..aebb074 100644
--- a/EmberAPI/clsAPIScanner.vb
+++ b/EmberAPI/clsAPIScanner.vb
@@ -1172,12 +1172,12 @@ Public Class Scanner

                     If Master.eSettings.TVScanOrderModify Then
                         Try
-                            inList = dInfo.GetDirectories.Where(Function(d) Functions.IsSeasonDirectory(d.FullName) AndAlso (Master.eSettings.TVIgnoreLastScan OrElse d.LastWriteTime > SourceLastScan) AndAlso isValidDir(d, True)).OrderBy(Function(d) d.LastWriteTime)
+                            inList = dInfo.GetDirectories("*.*", SearchOption.AllDirectories).Where(Function(d) Functions.IsSeasonDirectory(d.FullName) AndAlso (Master.eSettings.TVIgnoreLastScan OrElse d.LastWriteTime > SourceLastScan) AndAlso isValidDir(d, True)).OrderBy(Function(d) d.LastWriteTime)
                         Catch
                         End Try
                     Else
                         Try
-                            inList = dInfo.GetDirectories.Where(Function(d) Functions.IsSeasonDirectory(d.FullName) AndAlso (Master.eSettings.TVIgnoreLastScan OrElse d.LastWriteTime > SourceLastScan) AndAlso isValidDir(d, True)).OrderBy(Function(d) d.Name)
+                            inList = dInfo.GetDirectories("*.*", SearchOption.AllDirectories).Where(Function(d) Functions.IsSeasonDirectory(d.FullName) AndAlso (Master.eSettings.TVIgnoreLastScan OrElse d.LastWriteTime > SourceLastScan) AndAlso isValidDir(d, True)).OrderBy(Function(d) d.Name)
                         Catch
                         End Try
                     End If
@@ -1199,12 +1199,12 @@ Public Class Scanner

                         If Master.eSettings.TVScanOrderModify Then
                             Try
-                                inList = inInfo.GetDirectories.Where(Function(d) (Master.eSettings.TVIgnoreLastScan OrElse d.LastWriteTime > SourceLastScan) AndAlso isValidDir(d, True)).OrderBy(Function(d) d.LastWriteTime)
+                                inList = inInfo.GetDirectories("*.*", SearchOption.AllDirectories).Where(Function(d) (Master.eSettings.TVIgnoreLastScan OrElse d.LastWriteTime > SourceLastScan) AndAlso isValidDir(d, True)).OrderBy(Function(d) d.LastWriteTime)
                             Catch
                             End Try
                         Else
                             Try
-                                inList = inInfo.GetDirectories.Where(Function(d) (Master.eSettings.TVIgnoreLastScan OrElse d.LastWriteTime > SourceLastScan) AndAlso isValidDir(d, True)).OrderBy(Function(d) d.Name)
+                                inList = inInfo.GetDirectories("*.*", SearchOption.AllDirectories).Where(Function(d) (Master.eSettings.TVIgnoreLastScan OrElse d.LastWriteTime > SourceLastScan) AndAlso isValidDir(d, True)).OrderBy(Function(d) d.Name)
                             Catch
                             End Try
                         End If
find quote
Post Reply