Author Topic: Importing Episodes  (Read 11837 times)

0 Members and 1 Guest are viewing this topic.

Offline Testing_Business

  • Member
  • *
  • Posts: 12
    • View Profile
Importing Episodes
« on: May 28, 2010, 12:39:00 pm »
First of all I LOVE the program! Keep it free!

My issue is that I want to import episodes and series from an Excel file. Basically I have a list of files that are episodes of a Business Program that is not available on IMDB etc.

So I have created a list of names and paths. I also want to add a 'season/episode number' to the list of files eg season 1..2..3 episode 1...2...3.

How do I do this? I cannot find the episode field in the config of the excel plugin for importing? There is one for the text import plugin but it doesn't work properly and I don't know how the text should be formatted to allow only 3 fields (Title,path,Season/episode) to be imported.

I don't know if it is a requested feature, but a method of manually assigning an episode/season to an existing movie would be very useful. I believe at the moment you can only 'change' an existing season/episode number. Cut/Paste of a group of movies from the 'root' to a sub group of a season would also do the same thing!

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Importing Episodes
« Reply #1 on: May 28, 2010, 11:03:49 pm »
Welcome to the forum.

Quote
First of all I LOVE the program! Keep it free!

If the program were priced at what it's worth, none of us could afford it. Besides, I think nostra is much happier receiving your generous donation. I'm kidding—I'm sure he appreciates your LOVE as well. ;)

AFAIK, the only thing you can do is import the series (i.e., one record) with all the episodes included in the path field (separated by a "|", I assume). After import, select Movie - Organize files by episodes. This will create an episode record for each file. Unfortunately, this provides no means for importing details about the episodes, which is probably what you want. Besides, if you have the media, the file scanner should do this much for you automatically.

Quote
I don't know if it is a requested feature, but a method of manually assigning an episode/season to an existing movie would be very useful.

Yes, it would not be as efficient in this scenario as being able to import episodes directly, but perhaps a reasonable compromise. If there were the ability to attach (and detach) movies to other movie records to create series, we could do without the ability to import episodes. The same feature would also be useful for the more general purpose of grouping movies (it has been requested before).

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Importing Episodes
« Reply #2 on: May 29, 2010, 02:22:44 am »
Quote
After import, select Movie - Organize files by episodes.

Oops. It seems the episode records must exist for that function to work. So that's of no use. :-[

Offline Testing_Business

  • Member
  • *
  • Posts: 12
    • View Profile
Re: Importing Episodes
« Reply #3 on: May 29, 2010, 02:40:03 pm »
Yep. I tried that suggestion before and couldn't get it to work!

I think because of the issue that new episodes cannot be created without an existing epid record. So I would have to manually create episodes and then 'organise files' to those episodes. Too much hard work for 126 episodes!


The only way I thought I could get some automation into the import process was using the 'get movie information from text file' plugin. But I believe that plugin doesn't quite work or I don't have enough information on how it works to get it to work!

For example with the plugin I have deselected all options apart from: Title, Path, Episodes. If I could get this information imported I assume the records episodes/seasons would be created, and I would only then need to use 'organise files' to assign paths to the episodes.

Now I don't know how to format the text file with my movie/episode information. I would appreciate if anyone could give me a text example that I could import so the correct fields are filled and epid records created!

eg Apprentice, c:\tmp, 1, Episode 1, Sales (title of episode)
    Apprentice, c:\tmp, 1, Episode 2, Creativity

I want that to be Title, Path, Season Number, episode Number, Title of episode. How do I do this using the text file import plugin?

 

Offline Testing_Business

  • Member
  • *
  • Posts: 12
    • View Profile
Re: Importing Episodes
« Reply #4 on: May 29, 2010, 02:45:21 pm »
Another way would be to go into the database and use search and replace to add epid numbers!

Any idea on how to do this? Is the database file encrypted? Could you suggest a database editor that I could use to edit the data manually? ???

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Importing Episodes
« Reply #5 on: May 29, 2010, 04:10:10 pm »
I found Firebird Maestro to be pretty good, but it is not free. The database is not encrypted.
Gentlemen, you can’t fight in here! This is the War Room!

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Importing Episodes
« Reply #6 on: May 29, 2010, 08:16:29 pm »
Nostra, could you could provide a simple script to run in the SQL window? All that's needed is something that would add one dummy series record with an arbitrary number of seasons and episodes—like 10 seasons of 50 episodes. Those numbers could be changed in the script by the user, and, in any case, excess episodes are easily deleted. When this record's Title is set to the actual series name, the scanner should be able to assign the files to the proper episode record—and add the episode title, if it's included in the filename.

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Importing Episodes
« Reply #7 on: May 29, 2010, 08:40:29 pm »
It is not so simple as you might think:

To add a series:
Code: [Select]
SELECT gen_id(gen_mid, 1) from rdb$database
Code: [Select]
INSERT INTO movies ("mid", "title", "origtitle", "year", "series") VALUES(MID, 'NewTitle', 'NewOrigTitle', 'NewYear', -1)
Where MID is the result of the previous query.

Then for each episode you add a movie record similar to series and an episode record:

Code: [Select]
SELECT gen_id(gen_mid, 1) from rdb$database
Code: [Select]
SELECT gen_id(gen_epid, 1) from rdb$database
Code: [Select]
INSERT INTO episodes ("epid", "mid", "epnum", "season") VALUES(EPID, MID, EpisodeNumber, SeasonNumber)
Where MID is the result of the first query and EPID of the second one.

Code: [Select]
INSERT INTO movies ("mid", "title", "origtitle", "year", "series", "epid") VALUES(MID, 'NewTitle', 'NewOrigTitle', 'NewYear', 0, EPID)
Where MID is the result of the first query and EPID of the second one.

To create N episodes automatically you will need to create a stored procedure, so it is more complicated and I not in the mood of writing one right now ;)
Gentlemen, you can’t fight in here! This is the War Room!

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Importing Episodes
« Reply #8 on: May 29, 2010, 10:03:54 pm »
Quote
It is not so simple as you might think:

You could have convinced me with just two lines of code. ;)

I was just fishing for a quick 'n dirty solution to the immediate problem. If and when the ability to attach/detach episodes (i.e., convert movie records to episodes and vice versa) is added to the program, this should be considered as a complimentary program function. That is, a Movie menu item to create series with X seasons each with Y episodes. There would then be a number of different ways to create series records in situations where there is no online source.

In the meantime, the best solution to the problem at hand depends on which aspect is more important: (1) creating episode records and attaching files to them (possibly capturing Title and Year in the process), or (2) importing other information about each episode. Unfortunately, both are not possible.

If (1), I would manually create the 126 episode records using New Episode (tedious, but it would only take a few minutes). I would change the filenames to include Episode title and Year, if they didn't already, and then run the file scanner to attach the files and add this information.

If (2), I would abandon the idea of recording these episodes as a series, and import them as movie records instead. Doing so allows any available information to be imported using the CSV or Excel import plugins. See this post for more about how to do this.

Offline Testing_Business

  • Member
  • *
  • Posts: 12
    • View Profile
Re: Importing Episodes
« Reply #9 on: May 30, 2010, 01:46:47 pm »
Quote
If (1), I would manually create the 126 episode records using New Episode (tedious, but it would only take a few minutes). I would change the filenames to include Episode title and Year, if they didn't already, and then run the file scanner to attach the files and add this information.

This would be easier if there was a counter in the 'add episode' option that would automatically increment when I pressed the icon rather manually numbering each episode. Or an option to create x amounts of episode etc. Then if there was an option of taking the title of the episode from the filename when I press 'organise files', the filename could fill the title of the episode field.

As most file names of episodes correspond to their titles anyway would solve a part of the problem. There are plenty of tag/rename utilities out there to prepare the filenames before importing.

Quote
If (2), I would abandon the idea of recording these episodes as a series, and import them as movie records instead. Doing so allows any  available information to be imported using the CSV or Excel import plugins. See this post for more about how to do this.

I did that and it is ugly! Basically the 'plain view' of the database fills and looks very muddled. There are always too many episodes of series.

The other way is using the text plugin as suggested. Obviously the program imports episodes from the imdb site. And if thats the same for importing from the text file, I would appreciate a text file with filled dummy fields so that I could see how this being done.

Its then 5 minutes in excel with cut/paste/replace to make my episode list resemble an IMDB download.

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Importing Episodes
« Reply #10 on: May 30, 2010, 05:54:31 pm »
Quote
I did that and it is ugly! Basically the 'plain view' of the database fills and looks very muddled.

Not if you use a filter to hide them and/or group on the field used to record the series title.

Quote
The other way is using the text plugin as suggested. Obviously the program imports episodes from the imdb site. And if thats the same for importing from the text file, I would appreciate a text file with filled dummy fields so that I could see how this being done.

The TextInfo script is described here. I don't see any connection between it and the IMDb plugin. I suppose it does, however, provide another mechanism for importing data. Why don't you give that a try?

Offline Testing_Business

  • Member
  • *
  • Posts: 12
    • View Profile
Re: Importing Episodes
« Reply #11 on: May 31, 2010, 11:03:58 am »
Quote
The TextInfo script is described here. I don't see any connection between it and the IMDb plugin. I suppose it does, however, provide another mechanism for importing data. Why don't you give that a try?

I thought they were the same. That is the text file import was a local version for IMDB for testing etc.

I got that impression from the fact that both the plugins had the same configuration options, that contained an option for episodes.

Unfortunately the example text file (from the link file you gave me) doesn't contain any formatting for episodes. So I can't get it to work!

(I am trying to get a trial version of Maestro working so that I can edit the database manually - At the moment it keeps on saying your machine is actively refusing the connection- probably something to do with my firewall)

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Importing Episodes
« Reply #12 on: May 31, 2010, 12:53:36 pm »
Quote
(I am trying to get a trial version of Maestro working so that I can edit the database manually - At the moment it keeps on saying your machine is actively refusing the connection- probably something to do with my firewall)

Connect using embedded server instead of the normal one...
Gentlemen, you can’t fight in here! This is the War Room!

Offline Testing_Business

  • Member
  • *
  • Posts: 12
    • View Profile
Re: Importing Episodes
« Reply #13 on: June 01, 2010, 04:43:07 pm »
I wasn't sure how to do that so I used a normal server to get it to work.

However when I try to import data using a defined view, I get

"The object of the insert, delete or update statement is a view for which the requested operation is not permitted."

"01/06/2010 16:34 - Engine Error (code = 335544362):
cannot update read-only view VIEW03."

Any idea how to give it permissions to insert data?

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Importing Episodes
« Reply #14 on: June 01, 2010, 05:50:45 pm »
What view??? Can you describe exactly what is happening.
Gentlemen, you can’t fight in here! This is the War Room!

Offline Testing_Business

  • Member
  • *
  • Posts: 12
    • View Profile
Re: Importing Episodes
« Reply #15 on: June 01, 2010, 07:08:09 pm »
Sure.

I created a view selecting some fields from both movie and episode.

Quote
--View: VIEW03

--DROP VIEW VIEW03;

CREATE VIEW VIEW03
(
  MID,
  TITLE,
  PATH,
  EPID,
  EPNUM,
  SEASON,
  MID01
)
AS
SELECT
  MOVIES."mid",
  MOVIES."title",
  MOVIES."path",
  EPISODES."epid",
  EPISODES."epnum",
  EPISODES."season",
  EPISODES."mid"
FROM
  MOVIES
  LEFT OUTER JOIN EPISODES ON (MOVIES."epid" = EPISODES."epid");
GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES
  ON TABLE VIEW03
TO VIEW VIEW03;


I granted full permissions and full grants.

I then imported data in csv format for those fields assigning proper columns. But when I tried to import I got the message I described. I don't know if there is a default somewhere (in the server or meastro) that only loads the pvd file in read-only? Am I missing an option somewhere?

Offline Testing_Business

  • Member
  • *
  • Posts: 12
    • View Profile
Re: Importing Episodes
« Reply #16 on: June 02, 2010, 05:22:27 pm »
I have understood the issue. I believe the problem is that only one table can be updated at a time.

I think it was a valid try if certain fields in the tables could be selected and then data could be imported for those fields. Unfortunately for that to work the rest of fields are filled with NULL values.

There are too many fields constraints for that to work so data cannot be imported in large amounts directly through Maestro.

Will just have to wait until you develop a script for importing episodes from a text file.


Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Importing Episodes
« Reply #17 on: June 02, 2010, 05:41:52 pm »
All right. This feature will probably be available in version 1.
Gentlemen, you can’t fight in here! This is the War Room!